In My scenario, I want to insert the sql statements having 15 columns data.Is any other way to handle the parameter for insert statements?
public bool GetCustomersList(ref DataSet dataset, String x, String y, string z, string x1, string y1, string z1 )
{
MySqlConnection SQLConn = GetConnection();
try
{
string get_records;
if (SQLConn.State == ConnectionState.Closed)
{
SQLConn.Open();
}
if (searchtype == "x")
{
get_records = "INSERT into table values(x, y,z,x1,y1,z1);
}
MySqlCommand command = new MySqlCommand(get_records, SQLConn);
MySqlDataAdapter mySqlAdapter = new MySqlDataAdapter(command);
mySqlAdapter.Fill(dataset);
if (SQLConn.State == ConnectionState.Open)
{
SQLConn.Close();
}
return true;
}
catch (Exception )
{
if (SQLConn.State == ConnectionState.Open)
{
SQLConn.Close();
}
return false;
}
}
Here the parameter may be extended to 15 or more?How to handle this situation in asp.net?