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

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(object sender, System.EventArgs e)
{
String connectionString =
"Provider=SQLOLEDB;Server=local);database=Opus;use r id=sa";

SqlXmlCommand command = new SqlXmlCommand(connectionString);

command.CommandText = "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(command);
adp.Fill(datasetContract);

dataGrid1.DataSource = 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 2097

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.google.c om...
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(object sender, System.EventArgs e)
{
String connectionString =
"Provider=SQLOLEDB;Server=local);database=Opus;use r id=sa";

SqlXmlCommand command = new SqlXmlCommand(connectionString);

command.CommandText = "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(command);
adp.Fill(datasetContract);

dataGrid1.DataSource = 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
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...
1
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...
1
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...
1
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...
5
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...
3
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...
1
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...
1
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...
21
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...
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
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...

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.