Hi. I'm building an app (in VS2005) in which I have a datagridview with a combobox column that needs to be databounded. I use the dataSet designer to add a dataset and then add to the combobox column datasource the dataset I just added (make a reference) and then I get this error:

Type 'RequisitionPODataSet' is not defined in the next line of code:

Me.UnitsDataset = new RequisitionPODataSet.UnitsDataSet

I fix this temporarily by 2 ways: deleting the word RequisitionPODataSet (the name of the class where I reference the dataset) like this:

Me.UnitsDataset = new UnitsDataSet

or adding the word global like this:

Me.UnitsDataset = new Global.RequisitionPODataSet.UnitsDataSet

and it compiles succesfully, but then again when I go to the form again an recompile, it shows the error. So every time I compile, first I have to do what I said.

I googled this and found very little information about this problem. Only one thread in another site and forum where a person was having the same problem as me, only that he had the same name in a class as his root namespace (here is the url: http://www.thescripts.com/forum/thread720207.html), but that's not my case.

Could someone has gone through the same thing as me, or have any idea of what could be happening?

I appreciate any idea.

Regards Gabriela

Hi,

I have exactly the same problem, did you find a way out.
thanks in advance

Weymont

I didn't. Tried a lot of things and none of them worked. I would be very interesting if someone that had the same problem and worked through it could post a solution, but I had little time and could not wait so my solution was simply to do it by code.

Basically what I did was this: create a datagridviewcomboboxcolumn object, create a datatable and fill it with my query. Then I added the comboboxcolumn to my datagridview and assign its datasource to my datatable as following:

unidadDataAdapter As SqlDataAdapter,unidadesColumn As New DataGridViewComboBoxColumn

unidadDataTable = New DataTable
        query = "select idUnidad,Unidad from catUnidades order by Unidad" : Debug.Print(query)
        conn = New SqlConnection(connectionString)
        unidadDataAdapter = New SqlDataAdapter(query, conn)

        unidadDataAdapter.Fill(unidadDataTable)
        bsUnidades = New BindingSource
        bsUnidades.DataSource = unidadDataTable

        With unidadesColumn
            .DataSource = unidadDataTable
            .DataPropertyName = "idUnidad"
            .HeaderText = "UNIT"
            .Width = 80
            .ValueMember = "idUnidad"
            .DisplayMember = "Unidad"
            .Visible = False
        End With
        ReqProdGridView.Columns.Add(unidadesColumn)

I hope it helps you.

regards, Gabriela

Edited 3 Years Ago by happygeek: fixed formatting

This article has been dead for over six months. Start a new discussion instead.