DataTable
public DataTable getdetails(ComboBox descp, ComboBox veitype) { InitializeDB(); SqlCeCommand scmd = new SqlCeCommand(); DataTable dt = new DataTable(); SqlCeDataReader sdr; try { scmd = con.CreateCommand(); scmd.CommandText = "SELECT CHALLAN_CODE,CHALLAN_DESC,AMOUNT" + " FROM MB_MST_CHALLAN WHERE CHALLAN_DESC='" + descp.Text + "'AND (VEHICLE_TYPE='" + veitype.Text + "' OR VEHICLE_TYPE='A') AND STATUS='A'"; SqlCeDataAdapter da = new SqlCeDataAdapter(scmd); da.Fill(dt); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { scmd.Dispose(); CloseDbConnection(); } return dt; }
<pre lang="vb">Dim dt1 As New DataTable dt1.Columns.Add("name") dt1.Rows.Add("NAME1") Dim dt2 As New DataTable dt2.Columns.Add("name") dt2.Rows.Add("NAME2") dt2.Merge(dt1)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)