Sunday, February 19, 2012

best way to retrieve one row for use in code

i have a SQL backend and some of the data in my tables is more or less configuration data and some times i only want to pull one row of data which i can do just fine with a SQL query but whats the best method to pull it.

assume i have a query like this.

Select A, B, C from Table1 where ID=xyz

whats the easiest way to get A, B and C in to string variables?

I know i can use the sqldatasource control but i just feel there is too much overhead there.

whats your suggestions?

Thanks

Justin

I suggest that you use aSqlDataReader.

HTH,
Ryan

No comments:

Post a Comment