public class Emptab
{
public string rnumber;
public string sname;
public string depart;
public string active;
public string dsexecstatus;
public string dsmsg = "";
}
OdbcConnection odcon;
OdbcCommand comm;
DataTable dt = new DataTable();
string con = "Dsn=VD;uid=dba;password=sql";
public List insert(string[] as_connstring, List value)
{
List tDataList = new List();
Emptab tdata = new Emptab();
try
{
List arr = new List();
tdata.rnumber = arr[0].rnumber;
tdata.sname = arr[1].sname;
tdata.depart = arr[2].depart;
tdata.active = arr[3].active;
string ls_query="";
if (as_connstring[0] == "GET")
{
ls_query = @"insert into student values('" + arr[0] + "','" + arr[1] + "','" + arr[2] + "','" + arr[3] + "') ";
odcon = new OdbcConnection(con);
odcon.Open();
comm = new OdbcCommand(ls_query, odcon);
comm.ExecuteNonQuery();

Manas MohapatraPosted Jul 10, 2015, 7:28 AM