Jump to content
Sign in to follow this  

DataSource e DataSourceID estão definidos em 'GridView1'. Retire uma definição.

Recommended Posts



tou a criar parametros e depois de ter tudo criado ele dá-me este erro... nao sei o k fazer.. :S

Erro: "DataSource e DataSourceID estão definidos em 'GridView1'.  Retire uma definição."

Stored Procedure:

ALTER PROCEDURE dbo.StoredProcedure1


@id_carro int



select * from Carros where id_carro like ( @id_carro)


Código Parametros:

Dim comm As New SqlCommand

        comm.Connection = conn

        comm.CommandText = "StoredProcedure1"

        comm.CommandType = CommandType.StoredProcedure

        Dim p As New SqlParameter("@id_carro", SqlDbType.Int)

        p.Value = TextBox2.Text

        p.Direction = ParameterDirection.Input


        Dim dt As New DataTable

        Dim da As New SqlDataAdapter

        da.SelectCommand = comm


        GridView1.DataSource = dt


Ajudem-me por favor!


Share this post

Link to post
Share on other sites

Já ta resolvido =D

o problema era que estava a redireccionar os resultados da pesquisa para uma gridview ja com parametros predefinidos era so preciso por uma nova!

obrigado na mesma!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.