|
Thanks Mika!
|
|
|
|
|
You're welcome.
|
|
|
|
|
Hi All,
Im using a string to select some rows from my datatable:
string expression;
expression = "Act = '001' ";
DataRow[] foundRowsq;
foundRowsq = dtPar.Select(expression);
Now how can i the not equal token in my expression? when i doe this im getting a error:
expression = "Act != '001' ";
So what should i use instead of != ?
Thanx.
|
|
|
|
|
Try <> instead of !=
Mika
|
|
|
|
|
Hi, I am developing a windows application that reads info from IIS such as names of websites hosted and so on. I need to read the physical local directory of the website to know where it is situated on the hard drive. I can see it in the properties window under home directory tab but I cannot read it using code. E.g. Default Website -> C:\inetpub\wwwroot
Thank you.
|
|
|
|
|
use ServerMapPath
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
Thank you. I will try
|
|
|
|
|
or use Request.ApplicationPath
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Sorry but my application is windows not web.
Thanks.
|
|
|
|
|
For Each control In Me.Controls
MessageBox.Show(control.Name)
Next
How to do it in c#
Dabsukol
|
|
|
|
|
foreach(Control control in this.Controls)
{
MessageBox.Show(control.Name);
}
|
|
|
|
|
I have just created my first TCP client/server and it works fine. Because this is the only way i could figure out how to do it the client operates on a separate thread from the main program. I want to update a TextBox in the Windows Form from this separate thread.
I am getting strange behavior however: I set the TextBox.Text = "new text" + "\r\n" + TextBox.Text; This should add on the new text to what was already there, but instead the new text just replaces what was there. I have tried setting Control.CheckForIllegalCrossThreadCalls = false; and using an Invoke call to try and prevent illegal cross-threading, but neither solved this problem.
Thank you for your help ahead of time.
|
|
|
|
|
you cannot update a control from WindowsForm directly from another thread because windows form is run in separate thread, you have to invoke that control. I give this small sample but if this information not clear enough you have to search with key 'invoke windows form control'
in your form add this code
delegete void SetMyTextBoxCallback(string text);
public void SetMyTextBox(string text)
{
if (textBox1.InvokeRequired)
{
SetMyTextBoxCallback d = new SetMyTextBoxCallback(SetMyTextBox);
this.Invoke(d, new object[] {text});
}
else
{
textBox1.Text = text + Environment.NewLine + textBox1.Text;
Application.DoEvents();
}
}
then call SetMyTextBox method in where your code need to update text in textbox
hope it helps
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
Thank you, but i have already tried this (and just to make sure I copied your example above almost verbatim). I am not getting an error. Instead the text is behaving strangely.
I do this:
textBox1.Text = text + Environment.NewLine + textBox1.Text;
And the textBox just sets itself to text instead of adding text to the beginning. It acts as if I had written:
textBox1.Text = text;
Strangely enough if I write:
textBox1.Text = textBox1.Text + Environment.NewLine + text;
//just switched around the order of the text
Then it writes this out correctly . Unfortunately this isn't what I want.
Is this a strange behavior caused by threading or something else? Any more help would be greatly appreciated.
|
|
|
|
|
Okay, I kind of have it working. When I added a second call to the method from the main thread it suddenly started working for all threads. I still want to understand what was happening though, so if anyone has any ideas please let me know.
|
|
|
|
|
you may try using ListBox and insert your message at 0 index
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Hi! I am developing a little program to further my understanding of c# and have run into a problem. I am developing in visual 2005. I have built a GUI and have a small png image I am using in an image box. All of the code necessary for the GUI side was generated by visual. When I tried to compile it with the command line I got an error that said the type or namespace 'properties' does not exist in the namespace 'project'. The line of code it seems to not like is
this.pictureBox1.Image = global::project.Properties.Resources.imagename;
I would assume this(Properties) is some sort of reference for Visual to easily find the png file imagename. If I want to command line compile, what do I need to do? Thanks for the help!
|
|
|
|
|
I downloaded the DirectX 9.0c SDK (C#) from the Microsoft site and then installed it.
After that I wanted to compile a sample C# source and discovered that the References to DirectX were not available!
How do I get the DirectX assemblies on my PC so that I can use DirectX namespace(s)?
Do I need to download and install some more software for this? What do I need and where do I get it from?
Please some advice.
Thank you, Ranger.
|
|
|
|
|
Make sure you actually add a reference to the DirectX libraries in the Visual Studio Project (assuming, of cause, you're using VS). It isn't enough to just install the libraries.
|
|
|
|
|
It turned out I had only installed the DirectX SDK and not the runtime library.
It seems that new books about DirectX (like version 10) no longer use the C# programming language but use the C++ language instead.
From what I have read about DirectX I figure it is much more complicated than OpenGL, so I will stick to the latter...
Ranger.
|
|
|
|
|
hi. I am developing an IS and I was wondering on how I can load the heavy amount of data in a more efficient way. I was asked to also integrate an algorithm but I don't know where to put it and what to use. The program does much more in SQL queries than C# algorithmic codes. If you know what I mean. To explain it further, if I have about 1 million data entries in my database. How can I possibly load them in a jiffy?
|
|
|
|
|
harcaype wrote: if I have about 1 million data entries in my database. How can I possibly load them in a jiffy?
Why would you? I doubt you need them all at once.
|
|
|
|
|
i need them because new entries add up about every second. So when new entries are added up, I have to update/refresh it. And refreshing them again takes awhile to load. Also, I have a quick search option in the program, so if for example I will incorporate an algorithm for that search. Do you know the best to use? Because instead of searching all possibilities, it would just go straight to the search. I shouldn't be placing an algorithm actually, but I was required to do so.
|
|
|
|
|
harcaype wrote: So when new entries are added up, I have to update/refresh it.
There is no way you are displaying over a million rows on the screen simultaneously. At best you are displaying the aggregate result of those rows. In that case you should consider doing whatever calculation you are doing in the database itself.
If you do have a million rows available to your user then you might want to consider implementing some sort of paging where the system only gets the rows that are needed for the current display.
harcaype wrote: Also, I have a quick search option in the program, so if for example I will incorporate an algorithm for that search.
If you are doing this for a million rows, again a paging option is probably the best. You might want to have some sort of predictive fetch if you don't want the application to pause when scrolling. i.e. When you have scrolled two thirds the way through the current list, perform an asynchronous database query to fetch the next page worth of data. By the time the user has scrolled there it should be available.
|
|
|
|
|
i agree with Colin,
let database server handle it,
but if you insist to use custom retrieval system you must develop data retrieval management component that support memory table (to store your data) in your application and your database server needs to support events on insert, update and delete data and catch that events to your application, this means you must manage some delta handler to synchronize data between your application and database server
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|