Hey all i am pretty new to using C# i am attempting to display all records from a database table (tblDraw) where the "Ball1" field matches the value of my "tx1stBall" textbox. Am sure one of you should not have a hard time with this one.
The following code writes out all of the usernames in the table whose "Ball1" field matches. I would like to display the entire record of all those that match in a datagrid (DataGrid4)
Help very much appreciated.
foreach(DataRow mydataRow in dsDraw1.Tables["tblDraw"].Rows)
{
if (tx1stBall.Text == mydataRow["Ball1"].ToString())
{
Response.Write(mydataRow["Username"].ToString());
}
}
The following code writes out all of the usernames in the table whose "Ball1" field matches. I would like to display the entire record of all those that match in a datagrid (DataGrid4)
Help very much appreciated.
foreach(DataRow mydataRow in dsDraw1.Tables["tblDraw"].Rows)
{
if (tx1stBall.Text == mydataRow["Ball1"].ToString())
{
Response.Write(mydataRow["Username"].ToString());
}
}