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

Query

Scheduled Pinned Locked Moved C#
questiondatabasehelp
2 Posts 2 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.
  • N Offline
    N Offline
    Nekshan
    wrote on last edited by
    #1

    insert into dashboarddealerlogin (logoutdatetime) values (GETDATE()) It is giving error : Cannot insert value null in logoutdatetime. Anywaz, let it b. Just c this : private void logout_Click(object sender, EventArgs e) { conn.Open(); string strQury = ""; strQury = "insert into dashboarddealerlogin (logoutdatetime) values '(" + DateTime.Now + ")'"; SqlCommand cm = new SqlCommand(strQury, conn); int n = Convert.ToInt32(cm.ExecuteScalar()); } I have written this code in form1.cs n i have to write it here only. Now i want to use this 'int n' in a function in form2.cs funEntrylogin(m, i, tb_id.Text, tb_pswd.Text, DateTime.Now,n); but here it is giving error on 'n'. how can i do this? thanx. nekshan.

    V 1 Reply Last reply
    0
    • N Nekshan

      insert into dashboarddealerlogin (logoutdatetime) values (GETDATE()) It is giving error : Cannot insert value null in logoutdatetime. Anywaz, let it b. Just c this : private void logout_Click(object sender, EventArgs e) { conn.Open(); string strQury = ""; strQury = "insert into dashboarddealerlogin (logoutdatetime) values '(" + DateTime.Now + ")'"; SqlCommand cm = new SqlCommand(strQury, conn); int n = Convert.ToInt32(cm.ExecuteScalar()); } I have written this code in form1.cs n i have to write it here only. Now i want to use this 'int n' in a function in form2.cs funEntrylogin(m, i, tb_id.Text, tb_pswd.Text, DateTime.Now,n); but here it is giving error on 'n'. how can i do this? thanx. nekshan.

      V Offline
      V Offline
      virendra patel
      wrote on last edited by
      #2

      already replyed see belowed

      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