المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How Can i Create A Class Library For MSACCESS database Connection



C# Programming
04-25-2011, 05:51 PM
Hi All,

Iam New To C#

I Writed Code Like This
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;


namespace Access
{

public class Connection
{
OleDbConnection con;
OleDbCommand com = new OleDbCommand();

public void connect(string connectionstring)
{

con = new OleDbConnection(connectionstring);
con.Open();
}

public void Command(string Commandtext)
{

OleDbCommand com = new OleDbCommand(Commandtext);

}
public void ExecuteNonQuery()
{

com.ExecuteNonQuery();

}
public void CloseConnection()
{

con.Close();
}




}



}

Thease Statements are not working Correctly Really I Dont Know What to Do.
Can Any one Help me With A example Code?
Please Help Me.
Arunkumar