Query execution problen in C# program
-
I am using a program to insert values in a table in an SQLEXPRESS database. My program tells me that the queries are being executed but when I check on the Database Explorer in Microsoft Visual Studio 2005, I do not see the values. Kunle
-
I am using a program to insert values in a table in an SQLEXPRESS database. My program tells me that the queries are being executed but when I check on the Database Explorer in Microsoft Visual Studio 2005, I do not see the values. Kunle
-
I am using a program to insert values in a table in an SQLEXPRESS database. My program tells me that the queries are being executed but when I check on the Database Explorer in Microsoft Visual Studio 2005, I do not see the values. Kunle
do you have empty catch{} blocks ??
When you get mad...THINK twice that the only advice Tamimi - Code
-
I am using a program to insert values in a table in an SQLEXPRESS database. My program tells me that the queries are being executed but when I check on the Database Explorer in Microsoft Visual Studio 2005, I do not see the values. Kunle
Try to use Stored Procedures and verify it
-
I am using a program to insert values in a table in an SQLEXPRESS database. My program tells me that the queries are being executed but when I check on the Database Explorer in Microsoft Visual Studio 2005, I do not see the values. Kunle
you have read just inserting code on particular event using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.IO; namespace HotelProject { public partial class NewEmployee : Form { SqlConnection con; SqlCommandBuilder cmdb; SqlDataAdapter da; DataSet ds; public NewEmployee() { con = new SqlConnection("Data source=JBB-F906306D8CC\\SQLEXPRESS;Initial Catalog=Hotel;Integrated Security=SSPI"); InitializeComponent(); } private void btnBrowseImagePath_Click(object sender, EventArgs e) { OpenFileDialog op = new OpenFileDialog(); if (op.ShowDialog() == DialogResult.OK) { txtBrowseImagePath.Text = op.FileName; } } private void btnSubmitRecord_Click(object sender, EventArgs e) { con.Open(); da = new SqlDataAdapter("Select * From EmployeeDetails", con); cmdb = new SqlCommandBuilder(da); ds = new DataSet("EmployeeDetails"); if (txtBrowseImagePath.Text != "") { FileStream fs = new FileStream(txtBrowseImagePath.Text, FileMode.OpenOrCreate, FileAccess.Read); byte[] rawdata = new byte[fs.Length]; fs.Read(rawdata, 0, System.Convert.ToInt32(fs.Length)); fs.Close(); da.Fill(ds, "EmployeeDetails"); DataRow dr = ds.Tables["EmployeeDetails"].NewRow(); dr["FullName"] = txtFullName.Text; dr["FatherName"] = txtFatherName.Text; dr["DateOfBirth"] = maskedTxtDateofBirth.Text; dr["Gender"] = cmbgender.SelectedItem.ToString(); dr["Address"] = txtAddress.Text; dr["City"] = txtCity.Text; dr["Country"] = cmbCountry.SelectedItem.ToString(); dr["PhoneNo"] = txtPhone.Text; dr["EMailID"] = txtEMailId.Text; dr["LicenceNo"] = txtLicence.Text; dr["EmployeeHotelId"] = txtEhotelid.Text; dr["DepartmentName"] = cmbDepartmentName.SelectedItem.ToString(); dr["Designation"] = cmbDesignation.SelectedItem.ToString(); dr["Qualification"] = cmbQualification.SelectedItem.ToStrin