i m writting an application in which i add,delete and edit the records
i m using sql server
i have one table called Contacts in the database and few stored procedures in the database
i have method RetreiveContacts()
Code:
Private Sub RetrieveContacts()
Dim conn As New SqlConnection(My.Settings.AddressBookConnection)
Dim adapter As New SqlDataAdapter("Contacts_AllContacts_Select", conn)
Dim dt As New DataTable("Contacts")
adapter.Fill(dt)
dgContacts.DataSource = dt
End Sub
when i run my project ...error comes on following line
Code:
adapter.Fill(dt)
and error says"Could not find stored procedure 'Contacts_AllContacts_Select'"
but i have added this stored procedure into the database
i m attaching code and database files,kindly tell me the solution
thanks
Maybe you need a 'CALL' before your procedure name.
i.e Dim adapter As New SqlDataAdapter("CALL Contacts_AllContacts_Select", conn)
Thats the way it is in MySQL.
Does it work from enterprise manager?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
I will look at your Project Tomorow when i get to the Office. now i need to ask you some few questions about what i see in your Code
The SP "Contacts_AllContacts_Select", Who owns the Sp, For an Exampel , if you call a SP that is Owned by the different user just like that , well SQL is supposed to tell you that the SP does not Exists. try to put a User of the SP like this
Code:
dbo.Contacts_AllContacts_Select
To fid out who is the Owner of the SP, in your management Studio , Go to Database, digg below Programibility and choose the StoredProcedure and in the StoredProcedure, look for you Sp "Contacts_AllContacts_Select", Check the Prefix of the SP. If i helped rate me.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.