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

Q: dump dataset to a table in SQL server

Hello,

Here is part of my code to retrieve some data from FoxPro and populate
DataGrid. It works fine. What is the best and easiest way to import data from
Dataset to a table in SQL Server.

' populate dataAdapter and dataset
cmdSelect = Conn.CreateCommand
cmdSelect.CommandText = sqlStr
Da.SelectCommand = cmdSelect
Da.Fill(Ds, "ReturnedRows")
retValue = Ds.Tables(0).Rows.Count()
Response.Write("Row Count: " & retValue)

' populate datagrid
DataGrid1.DataSource = Ds
DataGrid1.DataMember = "ReturnedRows"
DataGrid1.DataBind()

Thanks,
Jim.

Nov 19 '05 #1
1 1857
The DataSet exposes a GetXml() method, which serializes the DataSet to an xml
string which can subsequently be sent to SQL Server with a few caveats
related to the amount of data in the DataSet....however...

Depending on what you ultimately want to accomplish with the data you may
not want to use the dataset as a data transformation service. You may be
better served setting up a DTS package that imports data from VFP into SQL
Server. DataSets aren't a data transfer service for large amounts of data
espacially when you have access to DTS in SQL Server.

The DataSet is great for disconnected access to data and binding to a
DataGrid like you mention. You can also leverage the DataSet as a container
for consolidating disparate data sources (ie, VFP and SQL Server) but if your
ultimate goal is to move data from VFG to SQL Server use DTS.

JP

"JIM.H." wrote:
Hello,

Here is part of my code to retrieve some data from FoxPro and populate
DataGrid. It works fine. What is the best and easiest way to import data from
Dataset to a table in SQL Server.

' populate dataAdapter and dataset
cmdSelect = Conn.CreateCommand
cmdSelect.CommandText = sqlStr
Da.SelectCommand = cmdSelect
Da.Fill(Ds, "ReturnedRows")
retValue = Ds.Tables(0).Rows.Count()
Response.Write("Row Count: " & retValue)

' populate datagrid
DataGrid1.DataSource = Ds
DataGrid1.DataMember = "ReturnedRows"
DataGrid1.DataBind()

Thanks,
Jim.

Nov 19 '05 #2

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

Similar topics

0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
12
by: Ed | last post by:
Hi All, I'm looking for an efficient way of dumping a table in a Dataset into an Excel sheet. I'm currently copying data cell by cell and this is rather inefficient for large Datasets. My...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
6
by: Együd Csaba | last post by:
Hi All, I'd like to dump out my database using plain text format. Everything is ok, but the bytea filds. Restoring the dump file (using <<psql -f LO_TRY_INSERT_BYTEA.sql tmp7>>) it sends an...
9
by: Mr Newbie | last post by:
HI People, Thanks to all who helped me earlier on the subject of @@IDentity. However, I seem to have hit another snagette! My DataSet contains two tables from the SQL Server. lets say Master...
3
by: P K | last post by:
Hello, I have a dataset which is already loaded with data in one table. so dataset.tables("data") exists and has data. Now, I have to add another table to the dataset. The source for this...
2
by: JIM.H. | last post by:
Hello, I am quite new in asp.net, here is the code I retrieve data from a web service SVP.ThisWebService.loadMethod lm = new SVP.ThisWebService.loadMethod(); System.IO.StringReader sr = new...
2
by: Jenden0 | last post by:
Ok, I'm trying to dump an SQL Server 2005 database to XML via C#, and I'm having some troubles. I'm relatively new to the whole .net thing, so there may be some stupid/basic questions/assumptions...
4
by: Al | last post by:
I have this scenario: 1. XML file with schema and data is created from SQL Server tables. XML file contains 6 tables, some of them have rows, some of them are empty. 2. XML file is given to the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.