remote connection to mysql server in ubuntu using vc# installed in other system

am using mysql server installed in ubuntu and i made the the remote connection successful.Even though the connection was successful am not able to access mysql namespace in c#,as am novice to this mysql can some one help me in this regard how can i access that mysql namespace and provide me some sample to execute queries like connection string and filling dataset with adapter classes .....

can i able to make the connection string using adodb? how can i do this some one can help me please

thanks in advance
LVL 7
Maverick_CoolAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mankowitzCommented:
Have you tried this?
MySql.Data.MySqlClient.MySqlConnection conn;
string myConnectionString;
    
myConnectionString = "server=127.0.0.1;uid=root;" +
    "pwd=12345;database=test;";
  
try
{
    conn = new MySql.Data.MySqlClient.MySqlConnection();
    conn.ConnectionString = myConnectionString;
    conn.Open();
}
catch (MySql.Data.MySqlClient.MySqlException ex)
{
    MessageBox.Show(ex.Message);
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mankowitzCommented:
also, to import the namespace, you;d use

using MySql.Data.MySqlClient;
0
mankowitzCommented:
oops. you said adodb. open the db with oledb then do this
using System.Data;
using System.Data.OleDb; 
using ADODB;

string DBConnection = "xxxx"";
string SQL = "select title_id,title,type,price from ....";

//create ADODB Connection object
ADODB.Connection Conn=new ADODB.Connection();

//create ADODB Recordset object
ADODB.Recordset rs= new ADODB.Recordset();

//create OleDb Adapter object
OleDbDataAdapter daTitles=new OleDbDataAdapter();

// finally Dataset to store returned recordset
DataSet dsTitles=new DataSet("Authors");

//open connection with the string as above
Conn.Open(DBConnection,"","",-1); 

//execute the query specifying static sursor, batch optimistic locking 
rs.Open(SQL,DBConnection,ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockBatchOptimistic,1); 

//use the overloaded version of Fill method which takes recordset as parameter
daTitles.Fill(dsTitles,rs,"Tiltes"); 

//bind datagrid to dataset 
dataGridTitles.SetDataBinding(dsTitles,"Tiltes"); 

///close the connection
Conn.Close(); 
}

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.