stored procedure in vb

March 1, 2011 at 12:43:32
Specs: gnu linux, 1 gig
myconnection = New SqlClient.SqlConnection("server=btc-db1;database=LOS_DocumentationSQLTest2;Trusted_Connection=True;Asynchronous Processing=true")
myconnection.Open()
mycommand = New SqlClient.SqlCommand("sp_socialattendance", myconnection)
mycommand.CommandType = CommandType.StoredProcedure
SqlCommandBuilder.DeriveParameters(mycommand)
mycommand.Parameters("@DateOnForm").Value = DateTimePicker1.Value.Date
ra = mycommand.ExecuteNonQuery
myconnection.Close()

The above code is ran when a date is picked from a date picker. the textboxes on the form do not populate with the data that the stored procedure pulls. I do in immediate window ?(mycommand.parameters("@DateOnForm").value and it says #2/15/11# (date) date: #2/15/11# Any suggestions would be welcome. thanks.


See More: stored procedure in vb

Report •


#1
March 1, 2011 at 18:18:41
SqlCommand.ExecuteNonQuery means, "run this command, and I don't want anything back from the database." If you want to retrieve data, use something like SqlCommand.ExecuteReader instead.

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question