|
hi
i think what are you missing is what the OleDbCommandBuilder dose !!
its define the sql commands from a specific adapter
Tamimi - Code
|
|
|
|
|
I need detect it, or at least know when the computer is connected, i think i can use wininet, but how? adding a timer and check if it's connected every second?
|
|
|
|
|
Congratulations on submitting almost one of the worst questions I've ever seen on the forum.
Try explaining in great detail: a) what are you doing b) what is going wrong c) what you suspect the problem is. And do it in clear English.
|
|
|
|
|
hi
i need to license component to create licence for my app (to Protect my app). does anybody take me free license component or source?
thanks .
|
|
|
|
|
I have a suspicion that one of the controls in my control array has not been properly instantiated. Because at least one of the controls in the control array was not instantiated properly when the form was loaded, then when those improperly instantiated controls in the control array are attempted to be randomized, they cannot be done properly because they were not instantiated properly in the first place. When I run the program without randomizing the control array, the application works fine.
Stephan was kind enough to provide some input as to how to randomize a control array. I should note that the randomization function itself works fine. The problem is somewhere possibly with the index in the control array. It is only when each of the elements from the randomized control array are parented to each other that I get the following error:
However, when I enable the randomization function, I get the following error:
"An unhandled exception of type 'System.NullReferenceException' occurred."
"Additional information: Object reference not set to an instance of an object."
I would really appreciate some insights as to how I could prove that each of the controls in the control array both before and after randomization has been properly instantiated. Trouble is, when I step through each of the steps, it appears to be a different control each time that it is not finding a reference assignment for the instance. I understand that there is a way to Trace() variables into a log file. Could somebody please provide a primer as how this is accomplished?
The slightly modified code for the randomization process is as follows. I would appreciate some additional input.
<br />
public CardControl[] cardName = new CardControl[53];<br />
...<br />
private void ShuffleCards(card[] cards)<br />
{<br />
ArrayList list = new ArrayList(this.cardName);<br />
Random rand = new System.Random();<br />
int j = 0;<br />
for (int k = 0; k < this.cardName.Length; k++)<br />
{<br />
j = rand.Next(list.Count);<br />
this.cardName[k] = (CardControl)list[j];<br />
string strCardName = this.cardName[k].Name;<br />
list.RemoveAt(j);<br />
}<br />
}<br />
Is there some kind of "Object Window" that I could use to see what objects have been instantiated correctly while stepping through the code. I would also need to know the properties of each object and their names.
-- modified at 14:53 Saturday 21st October, 2006
|
|
|
|
|
Do you put controls in all the elements in the array? Do you really have 54 cards in your deck?
---
b { font-weight: normal; }
|
|
|
|
|
Oops!!! You are right. I made the correction and now it works fine. For some reason, I always thought that 53 meant 52 but I always forget that it was really supposed to be the other way around. Thanks, Guffa!!!
-- modified at 15:35 Saturday 21st October, 2006
|
|
|
|
|
I've seen this sometimes in VB programs, where you specify the upper bound instead of the number of items.
Some programmers do this frequently without ever realising it, as dimensioning an item too much only causes an error if you use the size of the array and not a contant value, and only if you use the UBound function correctly, and don't think that it returns the number of items in the array.
---
b { font-weight: normal; }
|
|
|
|
|
Greetings:
I am a relatively new C# programmer and I have written a naive little utility which performs a task within a loop. This program is simple and the loop executes inside a routine belonging to the main form. The task that the loop performs does take some time though, maybe a few minutes, depending on various settings.
What I wanted, and this is the naive part, was to put some controls on the main form that update the user as to the status of the process. These are mostly just text boxes. When I want to update one or all of the text controls, I write the new string to the control's "Text" property.
What I have found though is that the form sometimes updates, but can go into this strange state of limbo where it simply stops updating or sometimes even goes blank. The main loop is still executing and the form will come back to life once the loop is finished. But I wanted the form to update continually throughout the process. I have also found that the form will update itself at first but if I click the mouse pointer on it or attempt to move the form on the display, then it freezes instantly and does not come back until the loop is finished.
I am an experienced MFC programmer and I know that this kind of thing happens if you fail to service the "message pump" from within loops of this sort. Have I missed something similar here? Or is this little utility simply an architectural accident-waiting-to-happen?
If the later is true, then what must I do to implement a long looping process that provides continually refreshed status to the user interface? Can you point me to books or articles?
Thanks in advance to anyone that responds
Mark
|
|
|
|
|
Do the loop in a new Thread and from there call yourcontrol.BeginInvoke() to update its contents.
This and this might help you
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you. That worked.
M.
|
|
|
|
|
Hi all:
I am doing a windows form application. I need to some textboxes which can only be inserted numbers like prices. Is there any existing component in windows application of C# please? What's the best way of achieving this please?
Thanks alot
Asura
|
|
|
|
|
Process the KeyDown event and check, if it's a number:
try
{
int number = int.Parse(textbox.Text);
}
catch (Exception e)
{
}
You could also use a MaskedEditBox (or how that is called, I haven't used this one yet)
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greeeg is definitely right, but I'd prefer a slightly different way than using exception. Here's the code:
<br />
private void AmountBox_KeyPress(object sender, KeyPressEventArgs e)<br />
{<br />
switch (e.KeyChar)<br />
{<br />
case '0':<br />
break;<br />
case '1':<br />
break;<br />
case '2':<br />
break;<br />
case '3':<br />
break;<br />
case '4':<br />
break;<br />
case '5':<br />
break;<br />
case '6':<br />
break;<br />
case '7':<br />
break;<br />
case '8':<br />
break;<br />
case '9':<br />
break;<br />
default:<br />
e.Handled = true;<br />
break;<br />
}<br />
}
Setting Handled to true prevents the input from being processed further and that is exactly what you want for anything else than numbers. BTW: This is a function for the KeyPress event.
Greetings
|
|
|
|
|
This is a better way still. Using execeptions is not a good idea.
private void AmountBox_KeyPress(object sender, KeyPressEventArgs e)
{
if(!char.IsNumber(e.KeyChar))
e.Handled = true;
}
|
|
|
|
|
if want to genarating report by using crytal report with microsoft access office,
got any ppl know how the coding writes?
my friend using database by microsoft sql can genarating report, but in microsoft access office is cannot.
y like that one?
|
|
|
|
|
got ppl know how to retrieve data from the cookie, by diffrence user get diffrence color??
private void btnselectedt_Click(object sender, System.EventArgs e)
{
DateTime dt = DateTime.Now;
TimeSpan ts = new TimeSpan(30,0,0,0);
HttpCookie mybg = new HttpCookie("bg");
mybg.Value = Convert.ToString(Session["assgroupID"]); //dotnot right or wrong, it try to bring ID
mybg.Value = ddlcolor.SelectedItem.Text;
mybg.Expires = dt+ts;
Response.Cookies.Add(mybg);
}
-------------------------------------------------------------------------------------------------------------------
string getbg()
{
return Request.Cookies["bg"].Value;
}
-------------------------------------------------------------------------------------------------------------------
...
...
if only can display in current page, but after logout already cannot retrieve form cookie. So, when login again cannot display
the bgcolor color that selected last time.
pls helping me what kind of problem on this coding, thank.
|
|
|
|
|
Lol. What is an "assgroup"?
What is it that you have in the session variable? Is it something that can be interpreted as a color?
Have you examined the html code that is produced, so see what value you actually get?
---
b { font-weight: normal; }
|
|
|
|
|
i use session to bring associatin group ID and store in to cookie, may be correct maybe wrong, becuase i also not sure
|
|
|
|
|
Hello,
I have an app that I use to get poll for the hostnames on my local network.
I use this method to get the information.
System.Net.IPHostEntry hostEntry = System.Net.Dns.GetHostByAddress(address);
The problem is that when GetHostByAddress(...) fails because there is no machine at a given IP address, it throws an exception that takes a long time (a few seconds).
Is there a faster method to call?
Is there a method that does the same thing, but sets an error value instead of throws an exception when a bad thing occurs?
Is there some kind of timeout setting that I can set to like 20 milliseconds? (I can be assured of always being on a lan with a fast response)
I use a whole bunch of threads to speed up the application, which makes the wait more tolerable, but it still takes way too long for my taste.
Is there a better method to use in .Net 2.0
Thanks.
|
|
|
|
|
Use the asynchronous BeginGetHostEntry method, it will not block.
(You can also use BeginGetHostByName , but it's marked as obsolete in .NET 2.0)
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi all, sometimes I need to raname e VS 2005 c# project but I receive several errors. Wich is the correct procedure to safely raname the project name, project directories an so on without having problems ?
|
|
|
|
|
|
excuzme.
in the name of god
hi.
c++ is famous for speed and running.
for graphic programing and game in next year c++ or c#?
how can i increase the speed of c# to speed of c++?
how dose not c# in commercial game?
|
|
|
|
|
ammoh - Microsoft is still actively improving the performance of the C# language and libraries. For information on using C# in scientific computing, check out this MSDN Magazine article[^]. The "Related Articles" section at the bottom of the page also provides some good advice on this topic. It's not too hard to relate these scientific computing concepts to gaming.
Good luck!
|
|
|
|