| | |
Type 'application.dataset' not defined in vb net
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2007
Posts: 5
Reputation:
Solved Threads: 0
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:
I fix this temporarily by 2 ways: deleting the word RequisitionPODataSet (the name of the class where I reference the dataset) like this:
or adding the word global like this:
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
Type 'RequisitionPODataSet' is not defined in the next line of code:
VB.NET Syntax (Toggle Plain Text)
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:
VB.NET Syntax (Toggle Plain Text)
Me.UnitsDataset = new UnitsDataSet
or adding the word global like this:
VB.NET Syntax (Toggle Plain Text)
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
•
•
Join Date: Dec 2007
Posts: 5
Reputation:
Solved Threads: 0
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:
[code]
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)
[\code]
I hope it helps you.
regards, Gabriela
P.S. If you find out a way to do this with the designer, please let me know. My email is gabriela.zuritaZURITA@gmail.com
The email is without the last ZURITA in capital letters.
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:
[code]
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)
[\code]
I hope it helps you.
regards, Gabriela
P.S. If you find out a way to do this with the designer, please let me know. My email is gabriela.zuritaZURITA@gmail.com
The email is without the last ZURITA in capital letters.
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Passing parameter to datagridview
- Next Thread: ok how about this
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array arrays basic bing button buttons c# center check checkbox code combobox convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output panel passingparameters picturebox picturebox1 port position print printing problem project read remove save searchbox searchvb.net select serial server shutdown soap sorting survey table tcp temperature text textbox timer timespan toolbox trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio2008 web winforms wpf year





