connectionstring not initiated

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to convert one of my vb.net program to c
I used Icollection to return a Bindlist.
My vb.net program works fine
But I encounter "connection string has not been initiated" proble

I checked the connection string and there is not any error. Below is part of the C# code that connect to sql

string sqlstr = "select * from anews order by counthere asc"
SqlConnection linka = new SqlConnection(ConfigurationSettings.AppSettings["beeeliboola"])

SqlDataAdapter dsCmd = new SqlDataAdapter(sqlstr, linka)
DataSet ds = new DataSet()
dsCmd.Fill(ds,"ahcha");

Please help. Thanks

Ra
 
Ray:

Can you post the connection string? The rest looks ok at cursory glimpse,
but perhaps something isn't coming in correctly because of an escape
character or something.
Ray Cheung said:
I am trying to convert one of my vb.net program to c#
I used Icollection to return a Bindlist.
My vb.net program works fine.
But I encounter "connection string has not been initiated" problem

I checked the connection string and there is not any error. Below is part
of the C# code that connect to sql
string sqlstr = "select * from anews order by counthere asc";
SqlConnection linka = new SqlConnection(ConfigurationSettings.AppSettings["beeeliboola"]);

SqlDataAdapter dsCmd = new SqlDataAdapter(sqlstr, linka);
DataSet ds = new DataSet();
dsCmd.Fill(ds,"ahcha");

Please help. Thanks.

Ray
 
Back
Top