problem in c#.net

08/24/2013 23:11 mohammedalhlo#1
please help the problem (The best overloaded method match for 'System.Data.Common.DbDataReader.GetString(int)' has some invalid argument)

code
---------------
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection(conStr);
string str = ("select * from اساسي where الاسم الكامل='"+comboBox1.Text+"'");
OleDbCommand cmd = new OleDbCommand(str, conn);
OleDbDataReader myreader;
try
{
conn.Open();
myreader = cmd.ExecuteReader();
while (myreader.Read())
{
string sname = myreader.GetString("اسم الام");

textBox1.Text = sname;
08/25/2013 08:27 qkuh#2
I guess you have to pass a column index to the function
08/25/2013 17:30 mohammedalhlo#3
I dno't understand well please explain more
08/25/2013 20:34 kissein#4
Quote:
System.Data.Common.DbDataReader.GetString(int)
GetString function expects an integer for the column and return this as string.

Always look at [Only registered and activated users can see links. Click Here To Register...]for details