473,394 Members | 1,810 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,394 software developers and data experts.

Dataset(xsd) cannot insert. Why?

Hi Guys,
There is the access DB, and the SQL server. I'm building an
application that can insert a new person, and details, into a DB.
(simple stuff?!) i'm however using a typed dataset created in visual
studio to an OleDb datasource. i then use the insert function to try
to insert into the DB.
the problem is it keeps raising errors depending on the DB chosen
(access or SQL) . if i create the dataset with access, it inserts only
to access. And when created with SQL server, it inserts only to SQL
server. Another prob is that even if i create the two datasets, how do
i determine which one to use depending on the DB the end user will be
using?

thanx for ur anticipated response.
Jun 27 '08 #1
1 3580
Hi Creamy!

You may want to ditch the visual dataset tool and create your datasets
programatically in code:

JetDataAdapter (?) daAccess = new JetDataAdapter(strJetConnectionString);
DataTable dtAccess = new DataTable();
SqlDataAdapter daSql = new SqlDataAdapter(strSqlConnetion);
DataTable dtSql = new DataTable();
daAccess.Fill(dtAccess);
daSql.Fill(dtSql);

Untested code. I don't use Access anymore, so I don't know what the
DataAdapter for it would be.

Of course, there are many more things to do using your databases, but the
code above should give you a kickstart in the right direction.

"creamy" wrote:
Hi Guys,
There is the access DB, and the SQL server. I'm building an
application that can insert a new person, and details, into a DB.
(simple stuff?!) i'm however using a typed dataset created in visual
studio to an OleDb datasource. i then use the insert function to try
to insert into the DB.
the problem is it keeps raising errors depending on the DB chosen
(access or SQL) . if i create the dataset with access, it inserts only
to access. And when created with SQL server, it inserts only to SQL
server. Another prob is that even if i create the two datasets, how do
i determine which one to use depending on the DB the end user will be
using?

thanx for ur anticipated response.
Jun 27 '08 #2

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

Similar topics

0
by: dbuchanan | last post by:
Hello, I used the wizard to create my dataset xsd in my data layer project. I then added a column to the database table. I tried several ways to refresh the TableAdapter with no success. *I...
0
by: dbuchanan | last post by:
Hello, How to I update a table or tableAdapter in my dataset1.xsd after I have added new columns to the underlying table? I refreshed the datasource in server explorer - it worked there but...
1
by: Dragon | last post by:
What is the use of .xsd, .xsx file in After Generate from typed dataset
2
by: Nick Hustak | last post by:
Hi, I've been trying to work with the XSDs and ran into a few road blocks. 1. Stored procedures that uses temp tables, i.e. #TempTable. The wizard complains that #TempTable is an invalid...
13
by: Rotsey | last post by:
Hi, I have created a typed dataset (xsd file) with 2 tables and a relation between them in VS2005. How I do I now bind that dataset to a Gridview?? When i do this the page is blank.
2
by: Magnus Bergh | last post by:
I have a solution which contains multiple projects (different applications). Every project use the same typed dataset (and also a few other shared code files). I tried to remove the dataset.xsd...
0
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I have set up some application settings and then created some datasets. Now, I removed some application settings but the dataset.xsds are still containing those information. How can I rebuild the...
6
by: marylipscomb | last post by:
I am using VB.NET. I am trying to connect a button so that when it is clicked the gridview pops up the data. Partial Class Switchboard Inherits System.Web.UI.Page Protected Sub...
5
nev
by: nev | last post by:
i used the datasources wizard to add table "lamesa" to my dataset. if i view the xsd file, "lamesa" has a tableadapter named "lamesatableadapter". but when i do...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.