473,404 Members | 2,137 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,404 software developers and data experts.

Changing values for unbound columns in a typed dataset

My application connects to a SQLite db and gets a number of fields
which are displayed in a list though a typed dataset.

I need to manually update an unbound column (which contains the index
of the picture, which is not stored in the DB) whose content is
decided by my application logic.

I've tried cycling though the rows

foreach (DatasetCommands.CommandsRow r in dsCommands.Commands.Rows)
r.ImageIndex = 1;

but the line that that actually sets the data is very slot. It takes
more than 30 seconds for updating about 4000 rows.

What's the proper way to do it?
Thanks.
Andrea
Dec 27 '07 #1
6 1635
Hello Andrea,

As far as I know, there is no Microsoft driver for SQLite DB. I've never
heard of "DatasetCommand.CommandsRow" either. It seems you are using 3rd
party library to connect to SQLite DB, correct? If I misunderstood anything
here, please don't hesitate to correct me.

If this is the case, 3rd party library is not supported by Micrsoft. I
suggest you may post this issue in some forums which is related to such 3rd
party library, because the people in those groups will be more likely to be
able to help and familiar with such product.

If you have any more concern, please feel free to update here. We are glad
to assist you. thanks.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 28 '07 #2
Thanks,

yes I'm using a third party library and the objects I mentioned are my
own. As far as I know, if I'm working with a typed dataset, it
shouldn't matter which database I'm using. Is that right?

I've noticed that iterating on the rows of a typed dataset and
changing the value of the data is very slow.

If I want to update manually 4000 rows, is it feasible to iterate on
the collection or should I use another method?
thanks.
Andrea
Dec 28 '07 #3
Hello Andrea,
Thanks for your reply.

Now, I understood you are working with a Typed Dataset which connects to
SQLite DB by 3rd provider. DatasetCommands.CommandsRow is written by
yourself, correct? If I misunderstood anything here again, please don't
hesitate to correct me.

I'm not sure how you implement the DatasetCommands.CommandsRow class. But,
iterating on the tableRows collection is the correct way in your case. It
should not take so long time to update 4000 rows. In following code
snippet, I created a TypedDataset instance, filled data into it by
TableAdapter, and updated the C2 column in table by iterating on
collection. Finally, I updated the change into Database by Table Adapter
again. I added stop watch into code to trace how much time is used on each
line of code. It takes me 136 milliseconds to update 4000 rows in cached
datatable, and 5917 milliseconds to update the change into SQL Database.

DataSet1 ds = new DataSet1();
DataSet1TableAdapters.Table_1TableAdapter tt = new
WebApplication29.DataSet1TableAdapters.Table_1Tabl eAdapter();
tt.Fill(ds.Table_1);

System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
watch.Start();
foreach (DataSet1.Table_1Row tr in ds.Table_1.Rows)
{tr.c2 = "100";}
watch.Stop();
Console.WriteLine("#1 UpdateTable Elapsed milliseconds {0}",
watch.ElapsedMilliseconds);

watch.Reset();
watch.Start();
tt.Update(ds.Table_1);
watch.Stop();
Console.WriteLine("#2 UpdateDatabase Elapsed milliseconds {0}",
watch.ElapsedMilliseconds);

//#1 UpdateTable Elapsed milliseconds 136
//#2 UpdateDatabase Elapsed milliseconds 5917

We highly recommend you add the stopwatch to check which line takes 30
second in your application.

Hope this helps,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Dec 29 '07 #4
Hello Andrea,

Had you have chance to try my suggestion so far? Do you face any further
issue?
Please feel free to update here again, if there is anything we can help
with. We are glad to assist you.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 2 '08 #5
Thanks for your help. I managed to solve the problem which had to do
with the actual dataset structure.
On Wed, 02 Jan 2008 11:30:54 GMT, v-******@online.microsoft.com
(WenYuan Wang [MSFT]) wrote:
>Hello Andrea,

Had you have chance to try my suggestion so far? Do you face any further
issue?
Please feel free to update here again, if there is anything we can help
with. We are glad to assist you.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
================================================= =
This posting is provided "AS IS" with no warranties, and confers no rights.
Jan 5 '08 #6
Hello Andrea,

You're welcome. It's my pleasure to assist you.
If there is anything we can help with on this issue, just feel free to
update here again. We are standing by. :)

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 7 '08 #7

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

Similar topics

0
by: bboyd | last post by:
:?: I have a stored procedure that returns 2 tables. One table with 8 columns and one table with 2 columns. I have set up a typed dataset that is similar to the data returned. However, in my typed...
11
by: eddy de boer | last post by:
Hello, in my aspx page I have the followong code: <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> .... <%# Server.HtmlDecode((string)DataBinder.Eval(Container.DataItem,"tekst"))...
24
by: Klaus Jensen | last post by:
Hi! How do I explore in code, which properties (columns) are in a datatable? I need to run some code for each column. I guess the answer is reflection somehow, but I dont know where to start....
1
by: tg.foobar | last post by:
my setup: visual studio 2005 sql server 2000 i'm using a dataset (used to be called typed dataset in 2003), where i use the MSDataSetGenerator to create a class for me based on the scheme of...
13
by: andrea | last post by:
Sorry for the stupid question, I know, but sometimes is necessary starts from the basic. I don't know how to pass the result of a method generated from a DAL class to a BL class returning the...
7
by: Max | last post by:
I've included the needed tables in the DataSource. Those tables that are bound to controls I can workwith. But how do you get access to the DataAdaptors that are not bound? me.Dataset1.table...
3
by: Aspnot | last post by:
I have a form that is setup in a Master/Detail configuration. The Detail section is represented with a DataGridView. Some of the columns in this DataGridView control are unbound. When a user...
9
by: =?Utf-8?B?UGV0ZXJX?= | last post by:
I have a TabControl on a Windows form in which I have various tab pages each with a DataGridView, the first column of which is a DataGridViewCheckBoxColumn and subsequent columns being...
1
by: Mark Baldwin | last post by:
Steven Thanks for your reply, however the typed datasets are defined in the web service and there seems to way to open the partial class code window - double clicking on the design surface does...
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: 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
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...
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
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
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
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,...

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.