When i exec my SQl server 2000 stored procedure in SQL server it gives me a table with like 10 entries. when i execute using datareader in VB, it gives me for Console.WriteLine(drAuthors.FieldCount) = 4 which is correct but when i try to loop through the record set there is not records?
VB
-----------------------------------------------------
ID = 1336
CC = "0010717"
money = "100.00"
Dim SqlServerConn As New SqlClient.SqlConnection(SQLConn)
SqlServerConn.Open()
STORPROC = New SqlClient.SqlCommand("dbo.p_get_dropdown", SqlServerConn)
STORPROC.CommandType = CommandType.StoredProcedure
STORPROC.Parameters.Add("@id", SqlDbType.Int)
STORPROC.Parameters("@id").Value = ID
STORPROC.Parameters.Add("@cc", SqlDbType.Char, 7)
STORPROC.Parameters("@cc").Value = CC
STORPROC.Parameters.Add("@money", SqlDbType.VarChar, 50)
STORPROC.Parameters("@money").Value = money
Dim drAuthors As SqlClient.SqlDataReader
drAuthors = STORPROC.ExecuteReader()
Console.WriteLine(drAuthors.FieldCount)
While drAuthors.Read()
MessageBox.Show("nothing" & drAuthors(0).ToString())
End While
drAuthors.Close()
SqlServerConn.Close()
SQL PROCEDURE
--------------------------
CREATE PROCEDURE dbo.p_get_dropdown
@id int, @cc char(7), @money varchar(50)
AS
.. . . . . .. .
SELECT * FROM #DROP_DOWN
order by drop_amt
Like is said when i "exec" this procedure in SQL server it returns like 10 rows. When i execute in VB it just returns the table with no rows but the 4 columns are there.
VB
-----------------------------------------------------
ID = 1336
CC = "0010717"
money = "100.00"
Dim SqlServerConn As New SqlClient.SqlConnection(SQLConn)
SqlServerConn.Open()
STORPROC = New SqlClient.SqlCommand("dbo.p_get_dropdown", SqlServerConn)
STORPROC.CommandType = CommandType.StoredProcedure
STORPROC.Parameters.Add("@id", SqlDbType.Int)
STORPROC.Parameters("@id").Value = ID
STORPROC.Parameters.Add("@cc", SqlDbType.Char, 7)
STORPROC.Parameters("@cc").Value = CC
STORPROC.Parameters.Add("@money", SqlDbType.VarChar, 50)
STORPROC.Parameters("@money").Value = money
Dim drAuthors As SqlClient.SqlDataReader
drAuthors = STORPROC.ExecuteReader()
Console.WriteLine(drAuthors.FieldCount)
While drAuthors.Read()
MessageBox.Show("nothing" & drAuthors(0).ToString())
End While
drAuthors.Close()
SqlServerConn.Close()
SQL PROCEDURE
--------------------------
CREATE PROCEDURE dbo.p_get_dropdown
@id int, @cc char(7), @money varchar(50)
AS
.. . . . . .. .
SELECT * FROM #DROP_DOWN
order by drop_amt
Like is said when i "exec" this procedure in SQL server it returns like 10 rows. When i execute in VB it just returns the table with no rows but the 4 columns are there.