Friday, February 17, 2012

empty resultset from sql2005

Hi,

I have used Red Gates SQL bundle to make an identical db on sql2005 express from sql 2000. When i run my query against the sql2000 i get what I want, but when i run it against the sql2005, i get nothing.

Anyone got any suggestions to why?

web.config:

<!-- <add name="TPLConnectionString" connectionString="Data Source=[SQL2000],1433;Network Library=DBMSSOCN;Initial Catalog=TPL;User ID=??;Password=????;"

providerName="System.Data.SqlClient" />

-->

<

addname="TPLConnectionString"connectionString="Data Source=[SQL2005]\\SQLEXPRESS,1433;Integrated Security=true;Network Library=DBMSSOCN;Initial Catalog=TPL;User ID=???;Password=???;"providerName="System.Data.SqlClient" />

default.aspx.cs

dbConnection.Open();

String ISPQuery ="SELECT STATEMENT";SqlCommand command =newSqlCommand(ISPQuery, dbConnection);SqlDataReader reader = command.ExecuteReader();

Please help!!!

Best regards

Terje Kristensen

Could you try using '(local)\SQLEXPRESS'rather than '[SQL2005]\\SQLEXPRESS''

I had a little difficulty with SQLEXPRESS being a bit precious. I don't know if it'll help but if you're out of ideas... Otherwise I'm being stupid and the '\\' is a typo :/

|||

Hi.

Thank you for replying. It did not help changing the servername to (local), but when I removed the following:

;Integrated Security=true;Network Library=DBMSSOCN

it suddenly worked!

Thank you for helping.

Best regards

Terje Kristensen

No comments:

Post a Comment