please any one explain this [Resolved]

Posted by Gow.Net under ASP.NET on 8/9/2012 | Points: 10 | Views : 944 | Status : [Member] | Replies : 2
my code
 BookID = objread.GetInt32(objread.GetOrdinal("BK_ID"))


how to process here and and what is the use of GetOrdinal any one tell me please

gowthaman8870226416


Responses

Posted by: San.Pblr.Gct on: 8/9/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
GetOrdinal performs a case-sensitive lookup first. If it fails, a second, case-insensitive search occurs (a case-insensitive comparison is done using the database collation). Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter 'i' in "file". The method throws an IndexOutOfRange exception if the zero-based column ordinal is not found.

GetOrdinal is kana-width insensitive.

Because ordinal-based lookups are more efficient than named lookups, it is inefficient to call GetOrdinal within a loop. Save time by calling GetOrdinal once and assigning the results to an integer variable for use within the loop.

Check this to know more about Getordinal.

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.getordinal.aspx

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oswaldlily on: 8/9/2012 [Member] Starter | Points: 25

Up
0
Down
u can reuse it several times for performance

Gow.Net, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response