C# .NET - how to use getstring in datareader
Asked By chitra ganapathy on 21-Jul-12 06:10 AM
hi, i want to select 1st 5 character and assign in stringarray, i tried the following code, but it showing me error
public string str;
OleDbDataReader dr = cmd.ExecuteReader();
str = dr.GetString(4).tostring();
i want to select first 5 character of each row and assign to str. Suggest me some idea plz.