|
please who u can use datagridview in WindowsCE alpplication I search 4 it alot but I don't find. I usually use datagrid and who u use checkbox in it.
I answered with a question (like politicals) sorry but please help me.
|
|
|
|
|
Okay what I'm trying to do is use the Dialog window to have the user find an Excel Database file (xls extension). I have searched Google, Msdn and the site.
Error:
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.
Code where OpenFileDialog is created:
<br />
private void import_db(object sender, EventArgs e)<br />
{<br />
OpenFileDialog search_for_file = new OpenFileDialog();<br />
search_for_file.AddExtension = true;<br />
search_for_file.CheckFileExists = true;<br />
search_for_file.DefaultExt = "xls";<br />
search_for_file.Multiselect = false;<br />
DialogResult result = search_for_file.ShowDialog();<br />
<br />
string file_name = search_for_file.FileName;<br />
}<br />
It throws the error when I get to the ShowDialog method.
|
|
|
|
|
Dumb question: Does you Main function have a STAThread attribute?
[STAThread]<br />
public static void Main(string[] args)<br />
{<br />
...<br />
}
|
|
|
|
|
If you mean "Did I put [STAThread] before your main function?" then no. I assume that that will fix the problem.
*Edit*
Yes that did it, Thanks.
|
|
|
|
|
I have a table named STAFF contains fields like STAFFID, FULLNAME, BIRTHDAY, SEX, PHOTO. I use BindingSource to update database. Initially, when I have no PHOTO field, updating database is successful. After that, when I add PHOTO field into STAFF table, the failure of updating database is due to having a following error
"The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time."
I have searched all helps but no article mentions it. Please kindly help me solve this error.
Thanks in advance.
It seem to be a solution or an answer.
|
|
|
|
|
|
Check into the sql query where u have given the new DBfield for updating
dhans
|
|
|
|
|
give us the sql query and code. so that we will check it and will say
dhans
|
|
|
|
|
Please help me
I want to print some things using a Mobile Pro Spectrum printer from an Optimus_PDA device. I work in c# .NET2005 please help me I want the correct dll I had Downloaded alot of them but it doesn't working .
So if some one help me by send me the correct dll or give ma an example I will be very thankful for him/her.
Bye Merry Christmas.
|
|
|
|
|
You asked this question yesterday[^]. People here respond on a volunteer basis, so you may not get a response in the timeframe you think is acceptable or desired.
Your question isn't very clear what you are actually trying to do. Are you trying to print files from the PDA to the printer from C# code? Or are you just generally trying to print a file?
In either case, you need to make sure that the printer is attached to your host computer and is working correctly. Can you print a test page? If not, I would suggest going to the manufacturers website for the printer and downloading the correct printer driver for your operating system.
You also need to make sure that the host computer is able to communicate with the PDA. This is generally done through the Microsoft ActiveSync software. If your host computer is able to "see" the PDA when it is connected, you should be able to access the file system on the PDA device and print the files.
If you need to do this through C# code, it is going to be more difficult.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
first thank u to answer me :
second :I want to print a text I write in C# code (some lines like this eg.
materialName Quantity Price Value
myMAterialName 2 50 100 )
just like this I want to print
third : I have print a test page and the printer work with an embedded program in the WindowsCE.NET5.0 device is called BTPrinter but I can't print the text I want in it.
In other words I want to print the text I want in my program.
thank u again.
|
|
|
|
|
I have a splitcontainer in the form. Initially I want left panel to spread over the whole client area and right panel should go hiding or invisible. When condition is right I want to show the right panel.
I tried by setting the SplitterDistance to the ClientRectangle.Width but left panel does not take the whole width instead give some minimum space (width)to Panel2. It looks like panel2 width can not be set to zero, it always need non zero width.
How can I make panel1 takes the whole space and hide the panel2 initially.
Any idea will be helpful.
Thank you.
|
|
|
|
|
Have you tried:
<br />
panel2.visible = false<br />
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
Can anyone give me some pointers/links to formatting text in a RichTextBox please.
I have googled and not found any tutorials - only references to things such as:
txtTips.Rtf = @"{\rtf1\ansi This is in \b bold\b0.}";
Which I can use but I would like to know how to underline, italicise, change font size etc...
I realise there is a good chance that I have been missing the obvious, either in my google searches or msdn searches so thank you for your patience in advance.
Regards
Guy Thiebaut
You always pass failure on the way to success.
|
|
|
|
|
|
Thanks,
That will help.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
|
Thanks,
Guess who did not search within CodeProject
A really useful link within the article is this one Clickety
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
I'm looking for something like the old Windows API FlushEvents().
I have a form which creates a COM object like such:
COMServerObject foo = new COMServerObject;
While my code waits for this singular statement to return, Windows makes my form window modal. If it takes a while for this statement to return - up to 20 seconds for .NET to give up and throw an exception - Windows queues up mouse clicks and keyboard events on my form, and then plays them back once the statement returns.
This is nasty, as the user hammers away at my unresponsive window, even trying to close it. So once the statement returns, my window can suddenly fly around the screen, resize, minimize, and even close.
I've tried disabling the Form while while I wait:
...<br />
this.Enabled = false;<br />
COMServerObject foo = new COMServerObject;<br />
this.Enabled = true;<br />
...
And this prevents clicks on my various buttons and menus. However, it does NOT prevent clicks on the window frame or title bar or close controls, so they still get queued up.
How can I prevent these from queuing? In the old Windows API, you could call FlushEvents when you got back from a modal state, which would remove all Windows events from it's message queue. I can't find anything analogous in the .Net framework. Anybody know the proper technique, here?
|
|
|
|
|
JoeRip wrote: Anybody know the proper technique, here?
Yeah, some asynchronous coding methods.
Put the call to your COM object in background thread so the primary thread is free to handle the events.
only two letters away from being an asset
|
|
|
|
|
So, nobody knows any way to flush events, then?
|
|
|
|
|
With a decent design, nobody ever needs to flush events. An app is not supposed
to ignore its user, if it can't or won't respond to some event, it should
disable the event sources to indicate so.
|
|
|
|
|
Luc Pattyn wrote: With a decent design, nobody ever needs to flush events.
This is an overly simplistic statement. Both the Mac OS and Win32 API's support a Flush Events procedure, which is recommended to prevent users from inadvertently losing work or destroying data.
In the professional productivity applications that I was personally involved in shipping, we frequently flushed queued up events when a dialog opened, to prevent a user who was typing in word processor from overwriting original values in the dialog controls without intending to do so.
While you may not agree that the situation I described needs an event flush, your statement that it is never necessary is incorrect.
|
|
|
|
|
Well, if you want your app to suddenly open a dialog, give it focus, and hijack all
on-going user input, then you are on your own I guess. I will try and avoid ever
using such an app, the way I see it the user is in control, not the app.
|
|
|
|
|
How bizarre that you would suggest that I want this. Where are you reading that I want an application to suddenly open a dialog?
Can you not simply admit that your statement was overly simplistic and incorrect?
|
|
|
|