I still don't get any records but here is an update of code.
This is the new and Updated Stored procedure:
CREATE PROCEDURE [dbo].[Search] (@param0 nvarchar(100), @param1 nvarchar(50),@param2 nvarchar(100),@param3 nvarchar(100),@param4 nvarchar(100),@param5 nvarchar(100),@param6 nvarchar(50))...
I still don't get any records but here is an update of code.
This is the new and Updated Stored procedure:
CREATE PROCEDURE [dbo].[Search] (@param0 nvarchar(100), @param1 nvarchar(50),@param2 nvarchar(100),@param3 nvarchar(100),@param4 nvarchar(100),@param5 nvarchar(100),@param6 nvarchar(50))...
I have also did ExecuteReader method with:
connection.Open();
SqlDataReader reader;
reader = sqlDataAdapter.SelectCommand.ExecuteReader();
while(reader.Read())
{
MessageBox.Show(reader.GetString(0));
}
MessageBox.Show(reader.GetString(0)); //to make sure
reader.Close()...
I decided to ExecuteNonQuery like this right before I call the fill method:
int counterR = 0;
sqlConnection1.Open();
counterR = sqlDataAdapter1.SelectCommand.ExecuteNonQuery();
MessageBox.Show(counterR.ToString());
sqlConnection1.Close();
I got -1 records affected. Something is not right...
I haven't done anything with a return value or anything like that, does the fill method take care of that with the dataset or is that where my error is.
I haven't done anything with a return value or anything like that, does the fill method take care of that with the dataset or is that where my error is.
Yes I have and I'm getting good advice but still nothing is working right. I don't know. I'll keep trying. If you get any more advice, I'll be happy to listen. Thanks.
All my data types are nvarchar and I have put it through the query analyzer and it works. I have made sure my variables are holding the right data then set the params in my c# code and then checked the params to make sure. But I still get no records. I just can't seem to figure this out. Thanks...
I did what you said to do and they are all holding the right values but I still get no records. I have also don't have any more <NULL> values being selected either. That didn't fix it either. I don't know what is wrong I must have something either set wrong or the stored procedure is wrong or...
I have tried it in the query analizer, and it works when I pug in the params with my own data, but when I use the params and pass the text to them it doesn't work, its as if the text is not getting passed right.
Please let me know if my stored procedure code is right.
Here is my stored procedure in my sql database:
CREATE PROCEDURE [dbo].[Search] (@param0 nvarchar, @param1 nvarchar,@param2 nvarchar,@param3 nvarchar,@param4 nvarchar,@param5 nvarchar,@param6 nvarchar,@param7 nvarchar)
AS
SET NOCOUNT ON...
Here is my stored procedure in my sql database:
CREATE PROCEDURE [dbo].[Search] (@param0 nvarchar, @param1 nvarchar,@param2 nvarchar,@param3 nvarchar,@param4 nvarchar,@param5 nvarchar,@param6 nvarchar,@param7 nvarchar)
AS
SET NOCOUNT ON;
SELECT Number, PartNumber, Description, Cost, Quote...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.