|
Hi all
There is a subtle bug what i can't resolve. Please help.
snippet 1
<br />
this.bindingSource.DataSource = this.dataTable;<br />
this.bindingSource.DataSource = null;<br />
this.bindingSource.Dispose();<br />
<br />
this.dataTable.Fill();<br />
snippet 2
<br />
<br />
Now i comment all code above, and supposingly this don't have any matter as such as i just return <br />
all to initiali state. BUT Now this operation (Fill) consume about <big>30 seconds</big>.<br />
*/<br />
this.dataTable.Fill();<br />
Any idea please. 30 more seconds very critical for me.
THANK.
|
|
|
|
|
Hi Guys
I think 30 sec is enough time. but not desired. So i think if we are put a thread to do the file operatoion and give high leve thread.may be this help to you reduce the time consume.
thanks
Cheers
RRave
MCTS,MCPD
|
|
|
|
|
Hello
I need to convert an XML doc (which has an XSL applied to it) to an HTML doc.
I tried this, but it does not allow me to specify a URL as a path:
XPathDocument myXPathDoc = new XPathDocument("C:\\SSW55P12902365.XML");<br />
<br />
XslCompiledTransform myXslTrans = new XslCompiledTransform();<br />
myXslTrans.Load("C:\\Style.xsl");<br />
<br />
XmlTextWriter myWriter = new XmlTextWriter("http://www.SpecifiedURL/SSW55P12902365.html", null);<br />
<br />
myXslTrans.Transform(myXPathDoc,null,myWriter);
If I use a folder path on the hard drive instead of the URL it works.
Is there any other (free) way to do this conversion?
Thanks
M
|
|
|
|
|
the dirty way :
<br />
string xmldata = new Webclient().DownloadString("http://your.desired.url/file.xml");<br />
XPathDocument myXPathDoc = new XPathDocument(xmldata);<br />
... //go on with your stuff.
maybe you want to structure it, add exception handling or use it in an async manner,
but it´s probably the right direction if you want to use a url instead of a local file.
|
|
|
|
|
I need to embed a cursor file into the application. How to do it?
The procedure what i have followed is:
* I added a existing cursor file into project.
* Changed the "Build Action" to "Embedded Resources".
* Code:
Cursor newCur = new Cursor("xyz.cur");
this.Cursor = newCur;
But it is throwing exception "Could not find file C:\App\rotate.cur".
I want to embed the cursor in my application.
|
|
|
|
|
In the solution explorer, go to the cursor file's properties and set Copy to output directory to Copy if newer .
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
It does NOT work.. Thanks for your reply.
|
|
|
|
|
I got the answer.
http://www.codeprof.com/dev-archive/37/9-31-373566.shtm
Thank you.
|
|
|
|
|
Anybody know if I can connect a C#.NET application to MYOB accounting software to view and update data?
Thanks.
|
|
|
|
|
hey there
i hav a lil problem with a toolStripButton
the following code is in my app
<br />
private void BtnSave_Click(object sender, EventArgs e)<br />
{<br />
method();<br />
}<br />
<br />
private void dataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e)<br />
{<br />
save = true;<br />
}<br />
<br />
private void FrmTimeCategories_FormClosing(object sender, FormClosingEventArgs e)<br />
{<br />
if (save)<br />
{<br />
string option = MessageBox.Show("Would You Like To Save The Changes?", "Question", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question).ToString();<br />
<br />
if (option == "Yes")<br />
{<br />
method();<br />
}<br />
else if (option == "No")<br />
{<br />
MessageBox.Show("Changes Will Be Lost");<br />
}<br />
else if (option == "Cancel")<br />
{<br />
e.Cancel = true;<br />
}<br />
}<br />
save = false;<br />
}<br />
<br />
private void btnDeleteRow_Click(object sender, EventArgs e)<br />
{<br />
foreach (DataGridViewRow row in dataGridView.SelectedRows)<br />
{<br />
TimeCatTable.Rows[row.Index].Delete();<br />
}<br />
<br />
TimeCatTable.AcceptChanges();<br />
SqlCommandBuilder sqlBuilder = new SqlCommandBuilder(dataAdapter);<br />
dataAdapter.Update(dataSet, "TimeCat");<br />
}<br />
<br />
public void method()<br />
{<br />
SqlCommandBuilder sqlBuilder = new SqlCommandBuilder(dataAdapter);<br />
dataAdapter.Update(dataSet, "TimeCat");<br />
<br />
save = false;<br />
}<br />
now the problem is this... the call to method() doens work in the toolstripbutton (btnSave) click handler. the program defenetly goes into it (i put a messagebox in to test that) but its doesnt save the changes to my database, but the method() in the formClosing handler does save it!
i put a normal button on the form aswell just to see and that worked too... im confused with this.
can anyone plz tell me why this happens?
Think big and kick ass
|
|
|
|
|
HarveySaayman,
Are you getting any exceptions? Put a try{} catch{} around "method()".
Also, It might be a good idea to go through the "dataSet" rows in the "method()" and print out the values that you are about to update to actually check, the value which you want is in there.
Regards,
Gareth.
|
|
|
|
|
i tried the try catch block, no exceptions. if i call method() from the btnSaveClick messageboxes will show and variables do change but these two lines wont do what they are supposed to
<br />
SqlCommandBuilder sqlBuilder = new SqlCommandBuilder(dataAdapter);<br />
dataAdapter.Update(dataSet, "TimeCat");<br />
if a put a normal button on the form and call method() with that it works perfectly and also if the form closes and the dialog asks if u want to save. its just the btnSave (toolStripButton) that wont do it
thanx
Harvey Saayman
Think big and kick ass
|
|
|
|
|
Dear all
Regards!
I am developing a Drawing Editor in C# and OpenGL like Autocad,I am using the Viewport having a Canvas, the editor can import the DXF files and drawing on the Canvas. now i have to include the facility of editing that 's "Move Drawing" and "Copy Drawing".
Kindly help me, using C#.
Regards
David
david
|
|
|
|
|
Hi,
I want to execute a dos command without using .bat files in C#.net application.plz reply....
Thanks in advance
Smithakrishnan
|
|
|
|
|
try this :
<br />
Process dosapp= new Process();<br />
<br />
dosapp.StartInfo.FileName = "dosapp.exe";
dosapp.StartInfo.Arguments = "/?";
<br />
dosapp.Start();<br />
|
|
|
|
|
When I'm trying to debug the sorce code downloaded from the following site, I got the exception, "An error occurred: Cross-thread operation not valid: Control 'stbMessage' accessed from a thread other than the thread it was created on."
"http://www.codeproject.com/KB/game/tictactoenetwork.aspx",
When I made exe to the solution, its working very fine.
Please guide me to debug the code.
Thanks and Regards,
Lalitha.
|
|
|
|
|
Winforms controls are not thread safe. If you must update a control from another thread of execution, you should use a delegate and then call this.Invoke() from the form.
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
Can any one help how to validate system's user name and password?
|
|
|
|
|
Hi: can anyone tell me how to set up an input class for XNA that works? I thought I've done it right, but when it checks input, nothing happens. (So far, it's only supposed to exit) I just want the basic idea o how I would go about doing this, even though it's simple. (I have Game1 class and Input class)
Thanks in advance.
- I love D-flat!
|
|
|
|
|
|
Hi all,
I have write a service to automate a server application. To start the application I need some IPs which are stored in a database. I read the database and get required IPs on my service and run the server.
Up to now everything is ok.
Now I want to check that there is multiple instance are available. Because I can start only one server at a time. To do this I try to use MUTEX, as in C++(my server is written on C++). Can you guys give me a help. I don't know that higher concepts to handle in C#.
Thanks a lot.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: Now I want to check that there is multiple instance are available.
Multiple instance of what? I don't think you can have multiple instances of a Windows service anyway. If it's a regular app that you only want one instance of, C# has a Mutex in System.Threading which fits the bill. Google is your friend[^]
Cheers,
Vikram.
"I will put my new found knolage to good use" - Captain See Sharp.
"Every time Lotus Notes starts up, somewhere a puppy, a kitten, a lamb, and a baby seal are killed." - Gary Wheeler.
|
|
|
|
|
hello,
my web app use DirectoryServices to query Active Directory. On customer side i'm getting following error:
The time limit for this request was exceeded.
This error appears ~2 minutes (~120 s) after method FindAll() had been launched. Google this error description i found:
Active directory queies can take a bit of time to process so you may have to extend the time available from the default. You can do this by adding a <httpruntime> section to the web.config file with an executionTimeout attribute. Take a look at
<a href="http://msdn2.microsoft.com/en-us/library/e1f13641.aspx">http:
default value for executionTimeout attribute is 110 seconds. So it seems my error appears because of timeout.
BUT customer says - other LDAP tools didn't produce such error, and find objects quickly.
So, why is my search too sloooooooow?
thanks,
max
|
|
|
|
|
What OS? When I wrote some LDAP code on Windows 2000 using COM a while ago it was blazing. Then I executing the same thing on XP and it would take about 10 minutes. I never did figure out the problem.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I don't know exactly but I suppose Win 2003
thanks,
max
|
|
|
|