473,386 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem Creating Dataset

Dear Sir - I have
spent several days (p/t) trying to create a Dataset using V.B. Net on
my Laptop Sony. I have tried using both a Access and a SQL Server
database and the same problem occurs. I would prefer to use .Net's
wizzards to create insert, update, delete and SQL statements.....to
save time for all future development. I could probably do it all
manual, but trying to avoid doint that.

In my Form, I was able to connect to it....see the table (only two
columns)...and even "Preview Data". [b:53cdb74c6c]
However, I am not able to "Create a
Dataset"[/b:53cdb74c6c] and when I right
mouse-clicking on the DataAdapter.......the error I get is
"there were problems generating dataset. To resolve this
problem, build the project, fix any errors and then generate dataset
again visual basic .net "

I rebuilt it.....and even re-created the Project. :(


Nov 21 '05 #1
8 1192
SSDango,

Did you:

Create a new project
Opened the toolbox and draged an oledbadapter to your form
Did all was what told in the wizard and succeeded that to the end without
error messages
Rightclicked on the "OleDbDataadapter1" what was than beneat as an icon on
your screen and clicked on generate dataset.

Without doing anything in between of that?

Cor
Nov 21 '05 #2
I did exactly what you suggested....no errors up to that point. The
error occurs when I then right-mouse clicked on Data Adapter and
tried creating DataSet. Here is the underlying Windows generated
code:

#Region " Windows Form Designer generated code
"

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents SqlDataAdapter1 As
System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlSelectCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlUpdateCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlDeleteCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlConnection1 As
System.Data.SqlClient.SqlConnection
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.SqlDataAdapter1 = New
System.Data.SqlClient.SqlDataAdapter()
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection()
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.DeleteCommand = Me.SqlDeleteCommand1
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "School", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("SchoolID", "SchoolID"), New
System.Data.Common.DataColumnMapping("School", "School")})})
Me.SqlDataAdapter1.UpdateCommand = Me.SqlUpdateCommand1
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT SchoolID, School
FROM School"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO School(School)
VALUES (@School); SELECT SchoolID, School FROM School " & _
"WHERE (SchoolID = @@IDENTITY)"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@School",
System.Data.SqlDbType.VarChar, 50, "School"))
'
'SqlUpdateCommand1
'
Me.SqlUpdateCommand1.CommandText = "UPDATE School SET School =
@School WHERE (SchoolID = @Original_SchoolID) AND (Sch" & _
"ool = @Original_School); SELECT SchoolID, School FROM School
WHERE (SchoolID = @" & _
"SchoolID)"
Me.SqlUpdateCommand1.Connection = Me.SqlConnection1
Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@School",
System.Data.SqlDbType.VarChar, 50, "School"))
Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_Scho olID",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "SchoolID",
System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_Scho ol",
System.Data.SqlDbType.VarChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "School", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@SchoolID",
System.Data.SqlDbType.Int, 4, "SchoolID"))
'
'SqlDeleteCommand1
'
Me.SqlDeleteCommand1.CommandText = "DELETE FROM School WHERE
(SchoolID = @Original_SchoolID) AND (School = @Original_" & _
"School)"
Me.SqlDeleteCommand1.Connection = Me.SqlConnection1
Me.SqlDeleteCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_Scho olID",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "SchoolID",
System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_Scho ol",
System.Data.SqlDbType.VarChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "School", System.Data.DataRowVersion.Original, Nothing))
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "data
source=DANGELO\VSdotNET;initial catalog=YorkvilleDB;integrated
security=SSPI" & _
";persist security info=False;workstation id=DANGELO;packet
size=4096"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(432, 398)
Me.Name = "Form1"
Me.Text = "Form1"

End Sub

#End Region

Nov 21 '05 #3
ssdangelo,

Strange, can you try it with a different table, not school, school by
instance

Cor
Nov 21 '05 #4
Cor - Unfortunately I'm at work now.....but I can tell you that I did
try it with different tables. I created a test table....and it
didn't work neither. I first ran into this problem using MS Access
Table.....then I installed a SQL Server engine and tried it with a
more rubust database. Same errors occured with both DB's. Also, my
laptop is in very good shape.....never had problem with it and do most
of my development work on it. I suspect that there may be some "bugs"
or problems with the early version of .Net that I have.

My ultimate goal is to avoid having to write most of the insert,
update, delete sql statements by hand (which I know I can eventualy
do). I'm trying to leverage the products ability to do some of the
"grunt" work. This evening (when I return from work), I plan on
trying the XML engine to see if I can create a "DataSet".. However,
I would still like to create the Dataset from a Table!!

Any thoughts?

Nov 21 '05 #5
SSdangelo,

The only thing I can think about now is that your virus checker does not
allow XSD files or something, that is the difference with an untyped
dataset.

Can you draw a dataset your self and than try to generate a dataset from
that.

Item is dataset and than just add one elemenent or something click on it
right click and than the same.

Cor
Cor - Unfortunately I'm at work now.....but I can tell you that I did
try it with different tables. I created a test table....and it
didn't work neither. I first ran into this problem using MS Access
Table.....then I installed a SQL Server engine and tried it with a
more rubust database. Same errors occured with both DB's. Also, my
laptop is in very good shape.....never had problem with it and do most
of my development work on it. I suspect that there may be some "bugs"
or problems with the early version of .Net that I have.

My ultimate goal is to avoid having to write most of the insert,
update, delete sql statements by hand (which I know I can eventualy
do). I'm trying to leverage the products ability to do some of the
"grunt" work. This evening (when I return from work), I plan on
trying the XML engine to see if I can create a "DataSet".. However,
I would still like to create the Dataset from a Table!!

Any thoughts?

Nov 21 '05 #6
Cor - Again late last night I did create a xsd file or dataset from
the xml schema. works great. However, I have absolutely no
experience using xml per-say......and not sure if it's a simple
matter of replacing the table driven dataset with an xml one. After
work I will investigate some more....and over the Labor Day weekend.

Also, I did play with the table/column data mapping on the code
generated by .Net. No luck on that frong......but I suspect that
the problem resides in this autogenerated code and I also suspect
that the early version of .Net that I have may have some "bugs" in
it.

Thanks and talk to you later.

Nov 21 '05 #7
What an idiot I was. The problem resided in the naming of one of my
directories..... I had placed the following character in my path
"&"....and it did something funky with the code generator. What
a fool I was!!

Take care all and good luck!

Nov 21 '05 #8
* ss*******@earthlink-dot-net.no-spam.invalid (ssdangelo) scripsit:
What an idiot I was. The problem resided in the naming of one of my
directories..... I had placed the following character in my path
"&"....and it did something funky with the code generator. What
a fool I was!!


For labels, you can set the 'UseMnemonic' property to 'False' to prevent
"&" characters from being treated as mnemonic prefixes.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thanks | last post by:
I have a routine that is called on Page_Init. It retrieves folder records from a database which I display as Link Buttons in a table cell. I set the table cell's bgcolor to a default color (say...
9
by: Harry | last post by:
Dear All, First of all, i have a database and i have to select the data in a table. In the web form, i have a checkbox in each rows. So that the use can select the row. initally, i am...
14
by: Venkat Chellam | last post by:
I have a peculiar problem. I have a simple web application which loads some data from the oracle table and display in the datagrid in the webpage and datagrid has page enabled which shows 10 rows...
3
by: Prozon | last post by:
Hi! I have problem naming my webservices. One of the problem is that I got naming conventions between my webservices and dataset that the services uses. Can someone please give me a good...
0
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create...
1
by: r2destini | last post by:
Hi Friends, I am new to .Net. So I don't know much. I am facing a problem in updating database through ADO.Net I am creating the dataset and there is no problem in the updation and...
4
by: Matt F | last post by:
I have an application that utilizes a dataset. I've found just today, that if the regional language settings are changed at the point of where I instantiate the DataSet an error is thrown of:...
5
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use netstat viewer to see if there is any connection open...
0
by: Syoam4ka | last post by:
My project is about jewellery. I have devided my jewelery into main types, which each one of them has sub types, and each one those sub types has the jewellery. I have a tabcontainer. It includes...
2
by: Jeff | last post by:
Hey ..NET 2.0 I'm developing an application which will perform some webservice calls and I believe having those calls in a separate thread may help the app run smoother No user are waiting...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.