473,569 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Typed DataSet & SQL XML/Urgently help needed.

Hi Guys

i having the same problem with Strongly typed dataset, I have created
a stronsetly typed dataset by draging table from Server explorer and
now i have retreived xml from SQL server 2000 and tried to populate
dataset but it populates 0 rows even though ml contains rows. If i use
regular Dataset instead of Typed dataset, then everything works just
fine..please help me as soon as possible, here is my code snippet.

I think you have solution to this prolem and could you please code
snippet to solve this problem.

using Microsoft.Data. SqlXml;

private void button3_Click(o bject sender, System.EventArg s e)
{
String connectionStrin g =
"Provider=SQLOL EDB;Server=loca l);database=Opu s;user id=sa";

SqlXmlCommand command = new SqlXmlCommand(c onnectionString );

command.Command Text = "SELECT * FROM Contracts FOR XML
AUTO,XMLDATA";
command.RootTag = "root";

//dsContract is typed dataset created by dropping table for server
explorer
dsContract datasetContract = new dsContract();

SqlXmlAdapter adp = new SqlXmlAdapter(c ommand);
adp.Fill(datase tContract);

dataGrid1.DataS ource = datasetContract ;
}

but above code does not fill dsContract dataset even though sqlCommand
does retrive rows.

I am seeking help desparately.

Waiting for positive reply.

Many thanks in advance.

Linesh
Nov 11 '05 #1
1 2112

Hi,

Have you tried :
DataSet ds = new DatSet(); ?
Thank you,
Monica Frintu

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
"Linesh Gajera" <li***********@ hotmail.com> wrote in message
news:22******** *************** ***@posting.goo gle.com...
Hi Guys

i having the same problem with Strongly typed dataset, I have created
a stronsetly typed dataset by draging table from Server explorer and
now i have retreived xml from SQL server 2000 and tried to populate
dataset but it populates 0 rows even though ml contains rows. If i use
regular Dataset instead of Typed dataset, then everything works just
fine..please help me as soon as possible, here is my code snippet.

I think you have solution to this prolem and could you please code
snippet to solve this problem.

using Microsoft.Data. SqlXml;

private void button3_Click(o bject sender, System.EventArg s e)
{
String connectionStrin g =
"Provider=SQLOL EDB;Server=loca l);database=Opu s;user id=sa";

SqlXmlCommand command = new SqlXmlCommand(c onnectionString );

command.Command Text = "SELECT * FROM Contracts FOR XML
AUTO,XMLDATA";
command.RootTag = "root";

//dsContract is typed dataset created by dropping table for server
explorer
dsContract datasetContract = new dsContract();

SqlXmlAdapter adp = new SqlXmlAdapter(c ommand);
adp.Fill(datase tContract);

dataGrid1.DataS ource = datasetContract ;
}

but above code does not fill dsContract dataset even though sqlCommand
does retrive rows.

I am seeking help desparately.

Waiting for positive reply.

Many thanks in advance.

Linesh

Nov 11 '05 #2

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

Similar topics

0
1686
by: Natehop | last post by:
I've been attempting to design an n-tiered framework leveraging .NET's strongly typed Dataset. My Framework will serve as the foundation to several client apps from Windows applications to web sites and web services. The architecture consists of a business rules tier, a data tier, and a common tier. The common tier contains my typed...
1
1220
by: EAI | last post by:
Hi, I need to place XML into a database. I created a typed dataset from the tables. Now the incoming XML might contain some null values. How do I handle them? I get errors when I try to load XML into Typed dataset when some of the elements are missing. Thanks!
1
1493
by: Andre Ranieri | last post by:
I'm designing an extranet web site that customers will use to log in and see their account history, make payments against their balance, etc. I've declared a strongly typed DataSet as a public static object in the main accounts page - "public Customer.DataSet dsMyData = new Customer.DataSet();" and populate the tables with information about...
1
287
by: Mythran | last post by:
Which would be the better solution? 1.) 20 Tables In 1 DataSet, no relationships. 2.) 20 DataSet's with 1 Table each. The tables have no relationship with each other (although they represent data retrieved from normalized databases, they are normalized themselves. Basically, if I have 20 tables in a single typed dataset, and I...
5
10618
by: moondaddy | last post by:
I'm caching a dataset in an asp.net session variable to hold a user's data. one data item I need to store is an image the user uploaded. My problem is that I don't know how to get the image into the dataset because I don't know what datatype to set the dataset column and then set this image to. I saw an example where someone defended a...
3
2741
by: Freeon | last post by:
Hi, I am looking for a way to sort a strong typed dataset. It would seem the most straightforward way is to use a dataview. The only problem is when I use the dataview I seem to loose the strong typed properties from my original dataset Anyone that can point me to an example of how to sort my dataset and maintain the use of my typed...
1
9343
by: Optimus | last post by:
Hi everyone, I currently develop an application in vs.net 2005 with vb.net. I was trying to use typed dataset and I've got in trouble for converting untyped dataset into Typed DataSet. I don't know why I cannot perform this casting operation properly. First off, I've got my Typed DataSet named "AuthInfo" declared and I then created an...
1
1355
by: Artificer | last post by:
I am creating an application that will have around 20 web forms. Should I create only one strongly typed dataset that includes all the DataTables required for all the forms or should I create one strongly typed dataset per web form that includes only the DataTables required by that specific form?
21
2398
by: Peter Bradley | last post by:
Hi all, This post is sort of tangentially related to my earlier posts on configuration files for DLLs. Does anyone know how to create typed DataSets using VS2005's new DataSet designer, but with the ability to configure the connection string via a config file? The designer seems to hard-code the connection string into the dataset...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7982
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5222
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.