Datareader(simple)
- From: Cdude <cameljs18@xxxxxxxxx>
- Date: Thu, 10 Apr 2008 00:04:05 -0700 (PDT)
SqlCommand findProducts = new SqlCommand("SELECT PRODUCT_TYPE_ID FROM
PRODUCT_TYPE WHERE [NAME] = 'Meals'", sqlConnection1);
This command returns a value of 17. How can i insert this value into
a string variable? Please help . I tried this but it wouldnt work
SqlDataReader myReader = findProducts.ExecuteReader();
while (myReader.Read())
{
ProdTypeID =
int.Parse(myReader["PRODUCT_TYPE_ID"].ToString());
}
.
- Follow-Ups:
- Re: Datareader(simple)
- From: Marc Gravell
- Re: Datareader(simple)
- Prev by Date: Re: Copy file to remote PC
- Next by Date: Re: destroyng object
- Previous by thread: Passing Data in MDI Parent form and Child Form
- Next by thread: Re: Datareader(simple)
- Index(es):