Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the following code I got the sql server exception.

dad = New SqlDataAdapter(str, ConnectionString)
dtbl = New DataTable("Circular")
dco = New DataColumn("no", GetType(Integer))
dco.AutoIncrement = True
dco.AutoIncrementSeed = 1
dtbl.Columns.Add(dco)
ds = New DataSet()
ds.Tables.Add(dtbl)
con.Open()


//in following line I got exception.. as follows
ExecuteReader: CommandText property has not been initialized

dad.Fill(ds, "Circular")

  DataGrid1.DataSource = ds
  DataGrid1.DataBind()
  con.Close()
Posted
Updated 14-Sep-10 2:58am
v3

1 solution

I'm willing to bet your str param is empty/null.

Using the debugger will really help. Honestly. It's already installed on your system (it comes with Visual Studio).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900