2 Replies - 2772 Views - Last Post: 26 June 2011 - 11:10 PM Rate Topic: -----

#1 antovivek  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-July 10

loading stored procedure into datagridview

Posted 24 June 2011 - 02:51 AM

HI to all,


I have a problem in populating datagridview using storedprocedure i tried but i cant get it. here is my code
which i used,


         ObjConn.OpenConnection()
            dCmd = New SqlCommand("USP_Details", ObjConn.oConn)
            
            Dim sqlda As SqlDataAdapter = New SqlDataAdapter(dCmd)

            dCmd.CommandType = CommandType.StoredProcedure
               

            Dim tb As New DataTable
            sqlda.Fill(tb)
            Me.dgv.DataSource = tb



when i use this empty row is inserting can any one help me it urgent


thanks in advance
anto vivek

This post has been edited by modi123_1: 24 June 2011 - 06:54 AM
Reason for edit:: please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: loading stored procedure into datagridview

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8374
  • View blog
  • Posts: 31,124
  • Joined: 12-June 08

Re: loading stored procedure into datagridview

Posted 24 June 2011 - 06:56 AM

What do you mean "can't get it"? Is there an error? If so what is the exception and what line? Is it working differently than expected? If so how is it working and how should it be? Please be more specific in helping us to help you.
Was This Post Helpful? 0
  • +
  • -

#3 antovivek  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 01-July 10

Re: loading stored procedure into datagridview

Posted 26 June 2011 - 11:10 PM

View Postmodi123_1, on 24 June 2011 - 06:56 AM, said:

What do you mean "can't get it"? Is there an error? If so what is the exception and what line? Is it working differently than expected? If so how is it working and how should it be? Please be more specific in helping us to help you.



hi thanks for ur response actually wht i need is my project contains stored procedures.previously i have populated the table data into datagridview with normal database but i cant populate the table data into datagridview using stored procedures.actually i dont know how to do tht i tried the code which i posted earlier it loads only one empty row into the
daatagridview can u hlp in this
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1