Answer Posted /

Is This Answer Correct ?    Yes No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we extend a class with private constructor?

513


How would you link the spring mvc framework and mvc architecture?

146


What are the data components used by Hadoop?

420


What is the cell division process directly related to the embryonic growth?

5


Explain how pipe flanges are electrically insulated?

571






Is form 38 mandatory to issue c form in up. thru online mode

1324


need the type of technical questions in written test

1597


What is a meant by medium object mapping?

176


Is binary tree a binary search tree?

469


What is frozenset?

467


What is web administration in blue prism?

113


Why is harmonic mean used to calculate f1 score and not the arithmetic mean?

62


What is a cost center? : co- cost center accounting

611


I have written the code as below. here problem is that dt remain null. how to solve thst please tell me. public partial class Form1 : Form { private DataTable DTable; private DataRow drow; public Form1() { InitializeComponent(); } private OleDbConnection getConnection() { OleDbConnection con=new OleDbConnection (@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\winApp for Student\winApp for Student\App_Data\SchooMgnSystem.mdb;Persist Security Info=True"); return con; } private void button1_Click(object sender, EventArgs e) { InsertData(); } private void InsertData() { if (DTable==null) { DTable = new DataTable(); DTable.Columns.Add("StudID", typeof(string)); DTable.Columns.Add("StudName", typeof (string)); DTable.Columns.Add("Address", typeof(string)); drow = DTable.NewRow(); drow[0] = txtStudID.Text; drow[1] = txtSTudName.Text; drow[2] = txtAddress.Text; DTable.Rows.Add(drow); grdStudent.DataSource = DTable; } else { drow = DTable.NewRow(); drow[0] = txtStudID.Text; drow[1] = txtSTudName.Text; drow[2] = txtAddress.Text; DTable.Rows.Add(drow); grdStudent.DataSource = DTable; } } private void button2_Click(object sender, EventArgs e) { string cmdstr; OleDbCommand cmd; OleDbConnection con = getConnection(); foreach (DataRow Drow in DTable.Rows) { cmdstr = "Insert into Student values('" + drow[0].ToString() + "','" + drow[1].ToString() + "','"+drow [2].ToString()+"')"; cmd = new OleDbCommand(cmdstr,con); try { con.Open(); cmd.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { con.Close(); } } }

2231


hoe to data grid use in sql server 2000?

1583