code for insert query
Hi..
code is here
public class functions
{
private OleDbConnection objConn;
private OleDbCommand objCmnd;
private conn clsConn;
public functions()
{
clsConn = new conn();
objCmnd = new OleDbCommand();
}
public string insertInto()
{
try
{
objConn = clsConn.openConnection();
objCmnd.Connection = objConn;
objCmnd.CommandText = "insert into test(First,Third) values('first','second')";
objCmnd.ExecuteNonQuery();
return "true"; // true is just for test.. and nothing else in this case..
}
catch(Exception Ex)
{
string str = Ex.ToString();
return str;
}
|