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

q; no insert

Hello,

I have this code get xml string from web service and I am trying to insert
it into my table in the SQl server through, it does not give any error but it
does not insret the records too, what is problem?

myWS.myDS ds = new myWS.myDS();
myWS.Service ws = new myWS.Service();
System.IO.TextReader tr = new System.IO.StringReader(ws.LoadTable());
ds.ReadXml(tr, XmlReadMode.DiffGram);

daSR.TableMappings.Add("Table", "myTable");
daSR.Update(ds);

May 24 '06 #1
5 1046
Where is the code that you use to insert into your database?

May 24 '06 #2
JIM.H. wrote:
Hello,

I have this code get xml string from web service and I am trying to insert
it into my table in the SQl server through, it does not give any error but it
does not insret the records too, what is problem?

myWS.myDS ds = new myWS.myDS();
myWS.Service ws = new myWS.Service();
System.IO.TextReader tr = new System.IO.StringReader(ws.LoadTable());
ds.ReadXml(tr, XmlReadMode.DiffGram);

daSR.TableMappings.Add("Table", "myTable");
daSR.Update(ds);


We're going to need to see the code from the webservice and what the
..LoadTable() method does.
May 24 '06 #3
Thanks for your help. I do not have a control over web service but they
return dataset via WriteXml. Here is what I am getting when I dump tr to a
string: This is the XML returned by Web service:

<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"><pTDS
xmlns="http://tempuri.org/pTDS.xsd"><myTable diffgr:id="myTable1"
msdata:rowOrder="0"
diffgr:hasChanges="inserted"><fNum>1064</fNum><fName>c4</fName><dD>ToDB</dD><dR>Nk</dR><ADT>2006-05-23T09:05:13.843-04:00</ADT><AUN>wssa</AUN></myTable><myTable
diffgr:id="myTable2" msdata:rowOrder="1"
diffgr:hasChanges="inserted"><fNum>1065</fNum><fName>t4</fName><dD>ToDB</dD><dR>Nk</dR><ADT>2006-05-23T09:05:28.687-04:00</ADT><AUN>wssa</AUN></myTable></pTDS></diffgr:diffgram>
"Ray Booysen" wrote:
JIM.H. wrote:
Hello,

I have this code get xml string from web service and I am trying to insert
it into my table in the SQl server through, it does not give any error but it
does not insret the records too, what is problem?

myWS.myDS ds = new myWS.myDS();
myWS.Service ws = new myWS.Service();
System.IO.TextReader tr = new System.IO.StringReader(ws.LoadTable());
ds.ReadXml(tr, XmlReadMode.DiffGram);

daSR.TableMappings.Add("Table", "myTable");
daSR.Update(ds);


We're going to need to see the code from the webservice and what the
..LoadTable() method does.

May 24 '06 #4
Thanks for your help.
Here is how I create my adapter:
string sqlStr = "myStoredProcedure";
SqlCommand sqlCmd = new SqlCommand(sqlStr, sqlConn);
sqlCmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter daSR = new SqlDataAdapter(sqlCmd);
SqlCommandBuilder cbSR = new SqlCommandBuilder(daSR);
"Will Asrari" wrote:
Where is the code that you use to insert into your database?

May 24 '06 #5
JIM.H. wrote:
Thanks for your help.
Here is how I create my adapter:
string sqlStr = "myStoredProcedure";
SqlCommand sqlCmd = new SqlCommand(sqlStr, sqlConn);
sqlCmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter daSR = new SqlDataAdapter(sqlCmd);
SqlCommandBuilder cbSR = new SqlCommandBuilder(daSR);
"Will Asrari" wrote:
Where is the code that you use to insert into your database?

Where do you open a connection?
May 25 '06 #6

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

Similar topics

3
by: Howard Hinnant | last post by:
I recently asked for a survey of multimap insert with hint behavior, in support of a paper I'm writing concerning lwg issue 233. My sincere thanks to Beman Dawes, Raoul Gough, Russell Hind, Bronek...
6
by: Mark P | last post by:
Some time ago I posted here about inserting into a set with a hint: ...
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
8
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
4
by: Chris Kratz | last post by:
Hello all, We have run into what appears to be a problem with rules and subselects in postgres 7.4.1. We have boiled it down to the following test case. If anyone has any thoughts as to why...
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
3
by: MP | last post by:
Hi Posted this several hours ago to another ng but it never showed up thought i'd try here. using vb6, ado, .mdb, jet4.0, no access given table tblJob with field JobNumber text(10) 'The...
6
by: lenygold via DBMonster.com | last post by:
Hi everybody: What is the best way to I have 10 tables with similar INSERT requiremnts. INSERT INTO ACSB.VAATAFAE WITH AA(AA_TIN, AA_FILE_SOURCE_CD, .AA_TIN_TYP) AS ( SELECT AA_TIN,...
1
by: EJO | last post by:
with sql 2000 enterprise Trying to build a stored procedure that will take the rows of a parent table, insert them into another table as well as the rows from a child table to insert into...
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: 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
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
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...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.