Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 00:00

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



problem in c#.net

Discussion on problem in c#.net within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2013
Posts: 3
Received Thanks: 0
problem in c#.net

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;
mohammedalhlo is offline  
Old 08/25/2013, 08:27   #2
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
I guess you have to pass a column index to the function
qkuh is offline  
Thanks
1 User
Old 08/25/2013, 17:30   #3
 
elite*gold: 0
Join Date: Aug 2013
Posts: 3
Received Thanks: 0
I dno't understand well please explain more
mohammedalhlo is offline  
Old 08/25/2013, 20:34   #4
 
kissein's Avatar
 
elite*gold: 0
Join Date: Sep 2005
Posts: 426
Received Thanks: 87
Quote:
System.Data.Common.DbDataReader.GetString(int)
GetString function expects an integer for the column and return this as string.

Always look at for details
kissein is offline  
Reply


Similar Threads Similar Threads
[Problem]Habe ein Problem und zwar spinnt mein VPC etwas(ohne Grund)?!
07/28/2011 - Metin2 Private Server - 10 Replies
Also wie schon gesagt meins Server spinnt wodurch kiks usw. kommen :( ich lade euch die Screens in den Anhang, mit der Hoffnung, dass ihr mir helfen könnt :) wäre echt sehr nice :)



All times are GMT +2. The time now is 00:00.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.