Windows Phone Developers

Friday, April 23, 2010

How to pass Database Field Name to SQLDataReader GetString Function

How to retrieve data from SQLDataReader using FieldNames in C# (.NET)

It is always better practice to use Field names instead of Index. You can decide which of the following is clear

string sPlayerName =  rdr[1].ToString();
             sPlayerName = rdr["PlayerFirstName"].ToString();

The best overloaded method match for 'System.Data.Common.DbDataReader.GetString(int)' has some invalid arguments
Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment