|
thanks for u replay, and here, i didn't use any index for my table i just use the select statement to fetch the record according to the input given by the user from the textbox,dropdownlist,...(here i just append the inputs to the query string and enter the final sting into the sqlcommand).is this the reason for the delay...?
Regards,
ayyp
|
|
|
|
|
You mean something like
string sqlQuery = "SELECT * FROM SomeTable WHERE SomeColumn = '" + _myTextBox.Text + "'";
?
You should try to find out whether it is really the sql command which is slowing things down. If yes then created indices on the columns you use in your where clause.
|
|
|
|
|
Ok this is what im trying to achive. A random number that conforms to a distrobution pattern, for example the normal distrobution where most of the numbers are around the center and as you move away from that point their frequency becomes less. e.g range 1-10 5 is the mean most numbers would end up around 4,5,6 where only a handfull would be 1 or 10.
dose anyone know of either a libary or a calculation to achive these sorts of results? or maybe some for of normal distrobution table?
any input or help would be greate
Ant
|
|
|
|
|
The following should do what your looking for. Some information on the normal distribution e.g. the meaning of parameters my and sigma here[^].
public class NormalDistribution : IDistribution
{
public double sigma;
public double my;
private Random generator;
private double help1;
private bool help2;
public NormalDistribution()
{
this.my = 1.0;
this.sigma = 1.0;
this.generator = new Random();
this.help1 = 0.0;
this.help2 = false;
}
public double Next()
{
if (this.help2)
{
this.help2 = false;
return this.help1;
}
else
{
for (; ; )
{
double v1 = 2 * this.generator.NextDouble() - 1;
double v2 = 2 * this.generator.NextDouble() - 1;
double w = v1 * v1 + v2 * v2;
if (w <= 1)
{
double y = Math.Sqrt(-2 * Math.Log(w) / w);
this.help1 = v2 * y * this.sigma + this.my;
this.help2 = true;
return v1 * y * this.sigma + this.my;
}
}
}
}
"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
|
|
|
|
|
i want ot us System.Windows namespace but it was not available there. after System. there r only web is available means (System.Web) no other option with W so how can i get the System.Windows name space
|
|
|
|
|
Are you working on a Windows application?
Pramod
|
|
|
|
|
yes on windows n want to try in on console
|
|
|
|
|
See at your reference, you must have a reference to System.Windows.Forms.dll
|
|
|
|
|
|
a console application does not contains the reference to the
System.Windows.Forms namespace
try adding a reference to this dll
Regards,
Pramod
|
|
|
|
|
|
I have following requirement which i am trying to achive in .Net C#
I have a main process with a simple form and some menu items.
On choosing one of these menu items, i want to start another process. This child process has a form with some user controls.
I would have to embed this child process inside the main process
as if I am adding the child process as a control to the main form.
Does anyone have any idea how can this be done.
I tried passing the window handle through remoting and set the parent of the child to the main frame. I get the look of the parent and child window with this.
How do i get the look of an embeded control?
Thank You
Madhu
|
|
|
|
|
HI,
if you want to have an embeded look don't put the User control on a form.
you can create a user control which will have all the required controls and then add this user control to the main form.
Hope that works for you,
Regards,
Pramod
|
|
|
|
|
No, i want the user control to be hosted in a seperate process..
How do I do that..
|
|
|
|
|
Then you need to start a separate thread for that
Pramod
|
|
|
|
|
|
Could you try to explain what you are actually trying to achieve? Why do those have to be separate processes? What you are trying to do looks like a dirty hack to me... probably there is a better way.
|
|
|
|
|
yes it is kind of a dirty hack.
I need to do some on the fly switching between different configurations
Each of these configs when chosen, need different settings in registry
and different assemblies to be loaded.
We are trying to see if it will be possible to achieve this, without user haing to restart the application everytime he wants to switch configs
|
|
|
|
|
Hi
I created setup for installation of my application (in C#) after converting it to Framework 2.0. However when install it on another machine I have a message that 'This setup requiers the Microsoft J#.Net redistributable package' etc.
When I looked into the project in fact there is VJ#.NET launch condition. I cannot delete that.
Is it normal that it is added automatically to the setup for application developed in C#?
Thanks for help
Ela
|
|
|
|
|
There is no problem anymore.
Thanks
Ela
|
|
|
|
|
how can i determine the axis of mouse pointer from any method?
|
|
|
|
|
watch this post:
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&fr=51
|
|
|
|
|
<br />
this.Cursor = new Cursor(Cursor.Current.Handle);<br />
Cursor.Position = new Point(Cursor.Position.X - 50, Cursor.Position.Y - 50);<br />
|
|
|
|
|
this code will set the position of mouse pointer. but i want to retrieve the position.
|
|
|
|
|
hello the same pa.
string xValue = Cursor.Position.X.ToString () ;<br />
string yValue = Cursor.Position.Y.ToString();
|
|
|
|