Does any one know what i have done wrong
-
i am trying to use the gridview to display information but its not building. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dbconnection As SqlConnection Dim command As SqlCommand dbconnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True") command = New SqlCommand("Select * from tblcustomers", dbconnection) dbconnection.Open() 'MsgBox("connection open") GridView1.DataSource = command.EndExecuteReader() <------error on this line GridView1.DataBind() dbconnection.Close()
-
i am trying to use the gridview to display information but its not building. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dbconnection As SqlConnection Dim command As SqlCommand dbconnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True") command = New SqlCommand("Select * from tblcustomers", dbconnection) dbconnection.Open() 'MsgBox("connection open") GridView1.DataSource = command.EndExecuteReader() <------error on this line GridView1.DataBind() dbconnection.Close()
solarthur01 wrote:
command.EndExecuteReader()
Shouldn't it be:
command.ExecuteReader()
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
solarthur01 wrote:
command.EndExecuteReader()
Shouldn't it be:
command.ExecuteReader()
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
many thanks. I used a different method: Dim myconnection As SqlConnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True") myconnection.Open() Dim ad As SqlDataAdapter = New SqlDataAdapter("Select * from tblcustomers", myconnection) Dim ds As DataSet = New DataSet ad.Fill(ds, "tblcustomers") GridView1.DataSource = ds GridView1.DataBind() myconnection.Close() Label1.Text = ("Database connection open") Do you know how i can use the sleep function to let it sleep before displaying the next record...so as supopsed to displaying all the records at once, it will display it in time interval of say 3000 mseconds??
-
many thanks. I used a different method: Dim myconnection As SqlConnection = New SqlConnection("Data Source=localhost\SQLEXPRESS;Initial Catalog=test;Integrated Security=True") myconnection.Open() Dim ad As SqlDataAdapter = New SqlDataAdapter("Select * from tblcustomers", myconnection) Dim ds As DataSet = New DataSet ad.Fill(ds, "tblcustomers") GridView1.DataSource = ds GridView1.DataBind() myconnection.Close() Label1.Text = ("Database connection open") Do you know how i can use the sleep function to let it sleep before displaying the next record...so as supopsed to displaying all the records at once, it will display it in time interval of say 3000 mseconds??
Use the
Timer
class."I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
Use the
Timer
class."I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
do you know how i can implement it or where i can get some information about it from?
-
do you know how i can implement it or where i can get some information about it from?
Google.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )