I want to use datareader do execute two queries but I need to read the second query first.
Is it possibel to get it using datareader?
the first query execute a stored procedure that insert rows on a table then the second query must get total of some fields.
Dim cnn As New SqlConnection(Global.GetConnectionString)
Dim cmd As New SqlCommand()
Dim dr As SqlDataReader
cnn.Open()
cmd.CommandText = "execute procedure;
select sum(field_1), sum(field_2) from table_1"
cmd.Connection = cnn
dr = cmd.ExecuteReader
Thank you very much
Ofsouto
Is it possibel to get it using datareader?
the first query execute a stored procedure that insert rows on a table then the second query must get total of some fields.
Dim cnn As New SqlConnection(Global.GetConnectionString)
Dim cmd As New SqlCommand()
Dim dr As SqlDataReader
cnn.Open()
cmd.CommandText = "execute procedure;
select sum(field_1), sum(field_2) from table_1"
cmd.Connection = cnn
dr = cmd.ExecuteReader
Thank you very much
Ofsouto