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. Visual Basic
  4. Datagridview problem

Datagridview problem

Scheduled Pinned Locked Moved Visual Basic
help
4 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.
  • S Offline
    S Offline
    soniasan
    wrote on last edited by
    #1

    Hi I am developing windows based application ... write this code to fill the datagridview..... i am getting error at fill that If con.State = ConnectionState.Open Then con.Close() con.Open() Dim sqlcommand1 As New SqlClient.SqlCommand("usp_FillVS", con) sqlcommand1.CommandType = CommandType.StoredProcedure sqlcommand1.Parameters.Add("@ApplicationNumber", SqlDbType.BigInt).Value = ApplicationNumber sqlcommand1.ExecuteNonQuery() Dim GDataAdapter As New SqlClient.SqlDataAdapter GDataAdapter.Fill(GDataSet, "Outbound_Data") DataGridView1.DataSource = GDataSet

    S 1 Reply Last reply
    0
    • S soniasan

      Hi I am developing windows based application ... write this code to fill the datagridview..... i am getting error at fill that If con.State = ConnectionState.Open Then con.Close() con.Open() Dim sqlcommand1 As New SqlClient.SqlCommand("usp_FillVS", con) sqlcommand1.CommandType = CommandType.StoredProcedure sqlcommand1.Parameters.Add("@ApplicationNumber", SqlDbType.BigInt).Value = ApplicationNumber sqlcommand1.ExecuteNonQuery() Dim GDataAdapter As New SqlClient.SqlDataAdapter GDataAdapter.Fill(GDataSet, "Outbound_Data") DataGridView1.DataSource = GDataSet

      S Offline
      S Offline
      Sandeep Kumar
      wrote on last edited by
      #2

      Hi, As u have not set any sql command for GDataAdapter u r getting that error.....

      Regards, Sandeep Kumar.V

      S 1 Reply Last reply
      0
      • S Sandeep Kumar

        Hi, As u have not set any sql command for GDataAdapter u r getting that error.....

        Regards, Sandeep Kumar.V

        S Offline
        S Offline
        soniasan
        wrote on last edited by
        #3

        Hi, Thanks for your kind reply. code is executed without any error but data is not displayed... i am working on window based application previously i work on web application so on simple thing i find difficult. If con.State = ConnectionState.Open Then con.Close() con.Open() Dim sqlcommand1 As New SqlClient.SqlCommand("usp_FillVS", con) sqlcommand1.CommandType = CommandType.StoredProcedure sqlcommand1.Parameters.Add("@ApplicationNumber", SqlDbType.BigInt).Value = ApplicationNumber sqlcommand1.ExecuteNonQuery() 'dataReader = sqlcommand1.ExecuteReader Dim GDataAdapter As New SqlClient.SqlDataAdapter ' OleDbDataAdapter myAdapter = new OleDbDataAdapter(myCommand); GDataAdapter = New SqlDataAdapter(sqlcommand1) GDataAdapter.Fill(GDataSet, "Outbound_Data") DataGridView1.DataSource = GDataSet

        S 1 Reply Last reply
        0
        • S soniasan

          Hi, Thanks for your kind reply. code is executed without any error but data is not displayed... i am working on window based application previously i work on web application so on simple thing i find difficult. If con.State = ConnectionState.Open Then con.Close() con.Open() Dim sqlcommand1 As New SqlClient.SqlCommand("usp_FillVS", con) sqlcommand1.CommandType = CommandType.StoredProcedure sqlcommand1.Parameters.Add("@ApplicationNumber", SqlDbType.BigInt).Value = ApplicationNumber sqlcommand1.ExecuteNonQuery() 'dataReader = sqlcommand1.ExecuteReader Dim GDataAdapter As New SqlClient.SqlDataAdapter ' OleDbDataAdapter myAdapter = new OleDbDataAdapter(myCommand); GDataAdapter = New SqlDataAdapter(sqlcommand1) GDataAdapter.Fill(GDataSet, "Outbound_Data") DataGridView1.DataSource = GDataSet

          S Offline
          S Offline
          Sandeep Kumar
          wrote on last edited by
          #4

          Hi,

          soniasan wrote:

          sqlcommand1.ExecuteNonQuery()

          comment the above line and try to execute the code...

          Regards, Sandeep Kumar.V

          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