Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Query execution problen in C# program

Query execution problen in C# program

Scheduled Pinned Locked Moved C#
csharpdatabasevisual-studio
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kunle Oladimeji
    wrote on last edited by
    #1

    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

    D T J S 4 Replies Last reply
    0
    • K Kunle Oladimeji

      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

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      Run the SQL Profiler and see what query is actually getting run on the database. This might help you find the problem.

      It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

      1 Reply Last reply
      0
      • K Kunle Oladimeji

        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

        T Offline
        T Offline
        Tamimi Code
        wrote on last edited by
        #3

        do you have empty catch{} blocks ??

        When you get mad...THINK twice that the only advice Tamimi - Code

        1 Reply Last reply
        0
        • K Kunle Oladimeji

          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

          J Offline
          J Offline
          Jacobb Michael
          wrote on last edited by
          #4

          Try to use Stored Procedures and verify it

          1 Reply Last reply
          0
          • K Kunle Oladimeji

            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

            S Offline
            S Offline
            seoamitk
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups