|
i think problem statement is as Follows
Problem statement: you have have data in datagrid and you are able to update any row but when u want to insert new row then last selected row or last row get updated
Solution: command Builder is well enough to insert new row or to update row.do one thing if there is data present in data table the ad new row and data table by DataTable.row.add(new object[]{value1,value2..}), and now refresh the dataSource
sameer
|
|
|
|
|
Hi All,
While am working for more that 5min.am getting aproblem as below...
The CLR has been unable to transition from COM context 0x192008 to COM context 0x192158 for 60seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment
(STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
so plz help me how to solve the problem to run the application for more than 20min.
Thanks in advance,
Rgds,
cnr369.
|
|
|
|
|
The error message means that one of your STA apartments is not pumping i.e it has blocked without processing incoming messages. Look for methods with the [STAThread] attribute and check if they are pumping.
|
|
|
|
|
hi
i want to Convert My DataTable to excel Project correctly . How to do ??
(i found an article [ Converting Database records to Excel file(Very simple code) ] that convert datatable to excel but it was not worked correctly (my records was collapsed and corrupted).
please give me an example that convert Northwind.Orders Table to Excel correctly .
thanks ..
|
|
|
|
|
Hello
You can export any DataTable to any Database provider -including excel-, by writing it to an Xml file. So for a table you'd use DataTable.WriteXml() , or for multiple tables use DataSet.WriteXml() . Then use an XmlWriter to write it to a file. There isn't much of a code in it actually.
Regards
|
|
|
|
|
how can we bind DataReader() results to a table in asp.net WebForm (in dynamic format)(without using DataAdapter())??Please help me.... its urgent....
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
the thing is i have a really large picture (1600 X 1200) and i have to put it in a picture box on a form. The form is at maximum size (1200 X 1000) so only a part of the picture is dyplayed becouse the picture box is larger than the form. The question is can implement some kind of scrollin on the picture and how do i do that?
rzvme
|
|
|
|
|
This should be possible by putting the PictureBox (full size of picture) into a Panel (wanted size) which is a scrollable control.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
my project does not depend on virsual connection and virsual dataset
and when i design the report i design it on virsual dataset after i finsh the design i remove the dataset and i asign for the report datasourse {My dataset} but when i run the report does not have the data in my dataset
how can i solve it
thanks for help
fatma
|
|
|
|
|
You might find this[^] documentation on MSDN helpful.
|
|
|
|
|
Hi Friends,
I developed a desktop applcation in .NET 1.1 frameework using C#.
The application works perfect in Windows XP or Windows 2000 Server environment, but in Windows 2003 server the application is really slow. The performance is degraded upto 200%. i.e. it takes 4 times more time in Windows 2003 server than under Windows XP or Windows 2000 server.
Can anyone tell me what is the problem and can it be rectified.
Thanks,
Sushant Duggal.
|
|
|
|
|
That's a fairly broad question, have you tried profiling the application? If you don't have a commerical profiler, try the CLR Profiler[^] from Microsoft.
|
|
|
|
|
I was doing some final testing on a program that I build last week, when I encountered the following error in a databound datagridview
DataGridViewComboBoxCell value is invalid
It happend without a real reason, because nothing has changed since the last test and that last test succeeded without error.
Anybody have a clue as what might be going on here? I checked the databinding, but that seems correct to me. So it must be something else.
WM.
What about weapons of mass-construction?
|
|
|
|
|
I have a "Back" link in aspx page.
If clicked on this link it go to previouspage. For this I wrote back
It is working fine.
But I also Have a continue button which inserts data into db when clicked on it.
So If i go back and click on continue new record is inserte for the same member i don't want that to happen.
I want to maintain state persistence.
how can I do this.
Can Anybody help me
Thanx in Advance
chanti
|
|
|
|
|
This question belongs in the ASP.NET forum.
|
|
|
|
|
private void WhatFormToShow(Form f)
{
f.MdiParent = this;
f.Dock = DockStyle.Fill;
f.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(f);
this.txtCurrentLoadedForm.Text = f.Name.ToUpper();
}
WhatFormToShow(FrmAdd);
when i call the function i got this error, that said "its a 'type' but us used like a 'variable'...what is the proper way of doing this? please help
-- modified at 3:18 Saturday 14th October, 2006
|
|
|
|
|
What is the exact (!) error message you get?
The compiler won't tell you "its a 'type'". What is 'its'?
Could it be that FrmAdd is the name of your form class and not the name of a form instance?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
All I can do is guesses.
I guess that you get the error at this line:
WhatFormToShow(FrmAdd);
and I guess that FrmAdd is a class name. Is this the case? If so you have to pass an object no a class to the method.
Regards
|
|
|
|
|
thanks for reply
Yup i want to pass the form class name so i can instantiate the form by using the function.
Im tired of typing...
FrmNew myF = new FrmNew();
myF.Show();
or if there are more form setting to setup.
i want to pass the form name so the function can create it and instantiate it automatically.
Im new to c# any links to enlighten me more on this subject please dont hesitate to point me to the right direction
Thanks
|
|
|
|
|
While you can achieve something like this using reflection, I strongly doubt that you should do it.
Giving "I'm tired of typing..." as the reason simply isn't enough. What are the advantages you get for the flexibility you lose?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Well, you want to make some sort of a Froms factory!! This is possible, but as Mav said... Why?? Each form has its own special properties to be initialized. Why don't you initialize them at design time once??
Anyway, I'm not in the position to judge or modify your coding style. All I wanted was to guide you to what I think is better than what you want. Trust me, this isn't the reason to make such a factory method.
Anyway, you can do it -like Mav said again- using Reflection namespace.
1- Declare your method as
MyMethod(Type TheForm)
2- Call it as
MyMethod(typeof(FormClassName));
3- In the Form you can call Assembly.CreateInstance() to create your form. Then using this object you can initialize it.
Yet, again... Does it really worth all this??
Regards
|
|
|
|
|
I see. Thanks mav and nader
I really wanted to implement this as part of my UI. I have created an mdi application that mimic the MS MONEY 2006 tab bar
tab ---> HOME BILLING INVENTORY
So if i click on the HOME TAB, it will only load a single form. this is all done in my FrmMain. this is why i have this sub.
private void SelectTabToView(string sWhatTab)
{
switch (sWhatTab.ToUpper()) {
case "HOME":
FrmHome F1 = new FrmHome()
F1.MdiParent = this;
F1.Dock = DockStyle.Fill;
F1.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(F1);
this.txtCurrentLoadedForm.Text = F1.Name.ToUpper();
break;
case "BILLING":
FrmHome F2 = new FrmHome()
F2.MdiParent = this;
F2.Dock = DockStyle.Fill;
F2.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(F2);
this.txtCurrentLoadedForm.Text = F2.Name.ToUpper();
break;
case "INVENTORY":
FrmHome F3 = new FrmHome()
F3.MdiParent = this;
F3.Dock = DockStyle.Fill;
F3.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(F3);
this.txtCurrentLoadedForm.Text = F3.Name.ToUpper();
break;
}
}
So i could have used the function
private void SelectTabToView(string sWhatTab)
{
switch (sWhatTab.ToUpper()) {
case "HOME":
WhatFormToLoad(FrmHome);
break;
case "BILLING":
WhatFormToLoad(FrmBilling);
break;
case "INVENTORY":
WhatFormToLoad(FrmInventory);
break;
}
}
This is much easier than typing all those redundant settings
Thats why i have decide to create a generic routine or a form factory to catter the loading of forms by just passing the form name.
If im not on the right path in doing this please advice on what to do
Maybe i was just looking how to hammer a nail with a jackhammer
|
|
|
|
|
Well, you can use generics;P
Or much simpler, this:
private void SelectTabToView(string sWhatTab)
{
switch (sWhatTab.ToUpper()) {
case "HOME":
{
FrmHome frm = new FrmHome();
WhatFormToLoad(Frm);
break;
}
case "BILLING":
{
FrmBilling frm = new FrmBilling();
WhatFormToLoad(Frm);
break;
}
case "INVENTORY":
{
FrmInventory frm = new FrmInventory();
WhatFormToLoad(Frm);
break;
}
}
}
private void WhatFormToLoad(Form MyForm)
{
MyForm.MdiParent = this;
MyForm.Dock = DockStyle.Fill;
MyForm.Show();
this.pnlCompositeCon.Controls.Clear();
this.pnlCompositeCon.Controls.Add(MyForm);
this.txtCurrentLoadedForm.Text = MyForm.Name.ToUpper();
}
Regards
|
|
|
|
|
Thanks for the Prompt reply, nader
I was about to go on this direction. As i was playing with the Refactoring menu
anyway thanks for the input its highly appreciated
|
|
|
|