Question

Locked

How do you insert data into MSSQL

By johnsaraka ·
I am stuck on the line when I am trying to insert the records into the db.
Thanks. John

classTPL TPL = new classTPL(_DatabaseConnection);
if (!File.Exists(this.tbSelectFile.Text))
throw new Exception("Input file not found!");

if (!File.Exists(@"e:\TPLImport.xml"))
throw new Exception("Mapping file not found.");

// we got the file here so lets open it and start the import process
//Create a clsKEAImport
if (checkBoxRecreate.Checked)
{
TPL.Recreate();
}

DateTime importtime = DateTime.Now;
TPL.Initialize();
TPL.importTime = importtime;

List<List<Field>> records = ParseFile(this.tbSelectFile.Text);
// Ok now lets insert that thing into the database

foreach (List<Field> record in records)
{

foreach (Field field in record)
{
TPL.Insert();

}

lblStatus.Text = "Records Inserted = " + records.ToString();
lblStatus.Refresh();
Application.DoEvents();
}

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Windows Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums