DataTable dt = new DataTable(); DataColumn d1 = new DataColumn("PIId"); DataColumn d2 = new DataColumn("PINO"); DataColumn d3 = new DataColumn("LCTRANDAte"); private void mytable() { dt.Columns.Add(d1); dt.Columns.Add(d2); dt.Columns.Add(d3);
using (SqlConnection conn = new SqlConnection(_connStr)) { string sql = "SELECT PIId, PINo, L_CTransdate FROM PInvoice"; using (SqlCommand cmd = new SqlCommand(sql, conn)) { using (SqlDataAdapter ad = new SqlDataAdapter(cmd)) { ad.Fill(dt); } } }
i want to search it from dt in button click event.
if any body help me best regurds.