SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ct"].ConnectionString); try { con.Open(); } catch (SqlException ex) { Response.Write(ex.ToString()); } DataTable dt = new DataTable(); string query = "select column_name from information_schema.columns where table_name ='" + Session["name"] + "' " + "order by ordinal_position"; SqlDataAdapter sda = new SqlDataAdapter(query, con); sda.Fill(dt); string ColumnsName_String = ""; for (int i = 0; i <= dt.Rows.Count - 1; i++) { ColumnsName_String = ColumnsName_String + "," + dt.Rows[i]["column_name"]; if (ColumnsName_String.StartsWith(",")) { ColumnsName_String = ColumnsName_String.Remove(0, 1); } dl.table_name = Session["name"].ToString(); dl.column_name = ColumnsName_String.ToString(); bl.updatedata(dl); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)