0
 Public Function getSelc()
            Dim com As New SqlCommand
            Sqlcon.Close()
            Sqlcon.Open()
            Try


                com = New SqlCommand("EXECUTE regionSelect '" & txtID.EditValue & "','" & txtRegion.EditValue & "','" & _ txtShortN.EditValue & "','" & txtStatus.EditValue & "'", Sqlcon)

               objDA.SelectCommand = com
               objDA.Fill(objDSs)                         '=> could not find stored procedure ( 'but I have it with the same name in my database ) 

               GridControl1.DataSource = objDS.Tables(0)  'this is my goal

               objDA.Dispose()
               com.Dispose()

               Sqlcon.Close()
               MessageBox.Show("The selected data set")

            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try

        End Function

Edited by kdejan87: Mistake

2
Contributors
5
Replies
63
Views
3 Years
Discussion Span
Last Post by AleMonteiro
1

Hi, first of all, put some description at your post, don't just drop the code.

So the problem seems to be that you can execute the stored procedure, right? Do you have permission to do so with the account your are logged in? Who is the owner of the SP? Try using the fully classified name like 'dbo.regionSelect'.

0

Okay. Thanks for the advice. The problem created because I had a connection but to the wrong base. I have another question. Is it possible to somehow fill the dataset and transmit to the datagrid, but only columns without data.But not using dataset1.tables (0). clear or similar. SO, only transmit columns without data. For example use code that i drop

0

Sorry mate, I really didn't understand what you want.
You want to fill an datagrid only with columns without data? What's the point? The datagrid would be empty.

0

This I have already solved. I apologize if I have not marked

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.