Click here to Skip to main content
15,898,990 members
Home / Discussions / C#
   

C#

 
GeneralRe: Graph vertex edge weights Pin
Gedrain4-Oct-05 8:26
Gedrain4-Oct-05 8:26 
QuestionWebresponse Question Pin
Steve Messer3-Oct-05 10:13
Steve Messer3-Oct-05 10:13 
GeneralRe: Webresponse Question Pin
Guffa3-Oct-05 14:19
Guffa3-Oct-05 14:19 
GeneralRe: Webresponse Question Pin
Steve Messer3-Oct-05 14:45
Steve Messer3-Oct-05 14:45 
GeneralRe: Webresponse Question Pin
seee sharp3-Oct-05 17:52
seee sharp3-Oct-05 17:52 
GeneralRe: Webresponse Question Pin
Steve Messer3-Oct-05 19:03
Steve Messer3-Oct-05 19:03 
GeneralRe: Webresponse Question Pin
Guffa3-Oct-05 23:59
Guffa3-Oct-05 23:59 
QuestionDataGrid refresh??? Pin
Small Rat3-Oct-05 8:32
Small Rat3-Oct-05 8:32 
Hi everybody:

I use the following code to display the data in a DataGrid Control:
OleDbConnection con = new OleDbConnection(StrConnectionString);
ad=new OleDbDataAdapter();
ad.SelectCommand = new OleDbCommand(strSQL, con);
OleDbCommandBuilder custCB = new OleDbCommandBuilder(ad);
DataTable tbl=new DataTable("Domains");
ds=new DataSet();
ds.Tables.Add(tbl);
ad.Fill(ds,"Domains");
tbl.PrimaryKey=new DataColumn[]{tbl.Columns["CategoryId"],tbl.Columns["DomainUrl"]};
dv=new DataView(tbl);
Grid.DataSource=dv.Table;
it works fine.

and after that I use
dsTmp=ds.Copy();
make another copy of the data and make some change to the dsTmp.

then I save the data back to db and refresh the Grid control by using:
BindingManagerBase bm=BindingContext[dsTmp,"Domains"];
bm.EndCurrentEdit();
ad.Update(dsTmp.Tables["Domains"]);
dsTmp.AcceptChanges();
RefreshDomains();
dsTmp.Clear();
refresh:
ds.Clear();
ad.Fill(ds,"Domains");

since I don't want the user see the middle result of the data change so I use dsTmp to hold the data and make the change. if I have less data, such as 100 rows or less, the code works very well. But if I have lots of data (1 million rows), there is an exception comes out,and the grid can not be drawed. even I just update 2 rows of the 1 million rows.
also cause the exception happens at the "paint event" (I guess), I can not see which line of code cause the problem!

Does anyone has an idea about it?

Thanks a lot!

Alan shen







Alan Shen

MCAD for .NET Version
^~^~^~^~^~^~^~^~^~^~^
Great idea is the beginging of success!
QuestionXML Format Pin
PHDENG813-Oct-05 7:47
PHDENG813-Oct-05 7:47 
QuestionRetrieving Data From a C++ Application Pin
budidharma3-Oct-05 6:59
budidharma3-Oct-05 6:59 
AnswerRe: Retrieving Data From a C++ Application Pin
miah alom3-Oct-05 7:14
miah alom3-Oct-05 7:14 
GeneralRe: Retrieving Data From a C++ Application Pin
budidharma3-Oct-05 7:28
budidharma3-Oct-05 7:28 
QuestionCommunicate With USB Port Pin
amirrezaie3-Oct-05 6:20
professionalamirrezaie3-Oct-05 6:20 
QuestionCan the base class detect changes in the inheriting class? Pin
jdavison20003-Oct-05 6:10
jdavison20003-Oct-05 6:10 
AnswerRe: Can the base class detect changes in the inheriting class? Pin
Member 10325913-Oct-05 6:34
Member 10325913-Oct-05 6:34 
GeneralRe: Can the base class detect changes in the inheriting class? Pin
jdavison20003-Oct-05 6:41
jdavison20003-Oct-05 6:41 
GeneralRe: Can the base class detect changes in the inheriting class? Pin
Dan Neely4-Oct-05 2:13
Dan Neely4-Oct-05 2:13 
QuestionHow to count the jobs shown in the taskbar and get their names (or texts)? Pin
bihshan.lin3-Oct-05 5:46
bihshan.lin3-Oct-05 5:46 
QuestionAborting Threads Pin
NitinR3-Oct-05 5:37
NitinR3-Oct-05 5:37 
AnswerRe: Aborting Threads Pin
S. Senthil Kumar3-Oct-05 18:58
S. Senthil Kumar3-Oct-05 18:58 
GeneralRe: Aborting Threads Pin
NitinR5-Oct-05 8:22
NitinR5-Oct-05 8:22 
Questionhelp req for interoperatibility Pin
arusmemon3-Oct-05 4:50
arusmemon3-Oct-05 4:50 
QuestionMissing operator message Pin
zaboboa3-Oct-05 4:39
zaboboa3-Oct-05 4:39 
AnswerRe: Missing operator message Pin
Guffa3-Oct-05 14:23
Guffa3-Oct-05 14:23 
QuestionQuestion about keyboard(be patience for answer this #@$%% question) Pin
Alex Cutovoi3-Oct-05 4:27
Alex Cutovoi3-Oct-05 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.