searching
-
i want to search for specific row in database: first: stored procedure create procedure search @name varchar (50) as select * from members where name = @name second:C# -create connection and open it -create command and set it to stored procedure -create parameter and pass value i want to search for to that parameter i want to know the index of that row sotred procedure returned to pass it to : DataRow dataRow = dataTable.Rows[index] to fill textboxs of other fields "phone,hire_date,email,..." textbox.text = dataRow["phone"];
-
i want to search for specific row in database: first: stored procedure create procedure search @name varchar (50) as select * from members where name = @name second:C# -create connection and open it -create command and set it to stored procedure -create parameter and pass value i want to search for to that parameter i want to know the index of that row sotred procedure returned to pass it to : DataRow dataRow = dataTable.Rows[index] to fill textboxs of other fields "phone,hire_date,email,..." textbox.text = dataRow["phone"];
:confused: If your Stored Procedure only returns one result (because the field 'name' is unique) then the index would be 0, which is the first row in the DataSet/DataTable that you filled using the Stored Procedure.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin Edbert Sydney, Australia