|
There are several ways to accomplish that, i've created a few apps using this feature (it gets boring though ) and most were built from an example found on codeproject. I say, look through the articles, those guys spend a lot of time writing them, and are worth reading!
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
I'm looking for a way to update bulk data from DataTable to a SQL server since the updating procedure row at the time takes a lot of time in a large scale database as the one i work with.
|
|
|
|
|
you can use the concepts of OpenXML for bulk updates in sql server. this can minimize ur updates from a number of rows to be updated to 1.
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Hi all,
Can any one suggest mw how to check selected node is parent or child for visualc# treeview control?
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
hi,
this will let u know if the node has another node as a child for it or no.
if it has a child it will retrun true.
if (treeView1.SelectedNode.FirstNode != null)<br />
return true;<br />
hope it helps.
best regards
jamil abou khalil
|
|
|
|
|
hi,
Thanks a lot
Know is Drop, Unknown is Ocean
|
|
|
|
|
hi,
your welcome. but please note that the method i gave to u will return true it the node has another node as a child for it. meaning that if a node i a child and has a child it will return true.
also it wont retrun true explicitly for the root nodes except they have a child or more.
if u need more help please contact me on my msn: jamilaboukhalil@hotmail.com
jamil abou khalil
|
|
|
|
|
hi this link might help you for treeview in c#
http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c91c.aspx#q1097q
regards
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
Dear Respected Programmers
Kindly let me know the method, How may I use lounch "netscape.exe" with "http://www.yahoo.com"? <= using C#
thank you
|
|
|
|
|
System.Diagnostic.Process.Start(@"netscape.exe", @"http://www.yahoo.com");
|
|
|
|
|
hi,
try using the link label.
jamil abou khalil
|
|
|
|
|
Hi,
I want to compare two objects. I make a object and get the services from my machine, after sometime I make another object and get the services form my machine. I compare the two and popup a messagebox with the result of the comparation. But always is "distint", and the services are the same.
How can I do this?
I have do a example what enclose.
example:
public partial class Form1 : Form
{
ServiceController[] scServicesA;
public ServiceController scTempB;
public ServiceController scTempA;
public Form1()
{
InitializeComponent();
scServicesA = ServiceController.GetServices();
int cuentaA = 0;
clbA.Items.Clear();
clbB.Items.Clear();
foreach (ServiceController scTempA in scServicesA)
{
cuentaA += 1;
clbA.Items.Add(scTempA.DisplayName + " (" + scTempA.ServiceName + ")" + "\r\n");
}
Timer tmr = new Timer();
tmr.Interval = 3000;
tmr.Enabled = true;
tmr.Tick += new EventHandler(tmr_tick);
lblCuentaA.Text = cuentaA.ToString();
}
public int cuentaB;
public void tmr_tick(object sender, EventArgs e)
{
clbB.Items.Clear(); //Borra lo que tenga.
cuentaB = 0;
ServiceController[] scServicesB;
scServicesB = ServiceController.GetServices();
foreach (ServiceController scTempB in scServicesB)
{
clbB.Items.Add(scTempB.DisplayName + " (" + scTempB.ServiceName + ")" + "\r\n");
cuentaB += 1; //incrementa el contador de servicios.
}
lblCuentaB.Text = cuentaB.ToString();
if (clbA.Equals(clbB)) MessageBox.Show("Son IGUALES");
else MessageBox.Show("Son DISTINTOS");
}
}
Thanks,
Fernando
|
|
|
|
|
Fernando, you haven't received any replies because you posted a whole bunch of code, with no formatting (next time use <pre> tags around the source code), and the source code variables and comments are in Spanish. Could you clarify exactly where the problem in your code is?
|
|
|
|
|
I want have a object with the initial services from my machine (in the code "scServicesA"), and perdidically compare that services ("scServicesA") with the actual services in the machine (in the code "scServicesB"). I want check if something to add or delete some service in my machine.
The problem is: when I compare ("if (scServicesA.Equals(scServicesB)) MessageBox.Show("IS THE SAME");"), the response is always the same "IS NOT THE SAME", even if I add or delete services.
The next is only an example to know how compare, really I want compare the services what are running ("ServiceControllerStatus.Running").
example:
public partial class Form1 : Form
{
ServiceController[] scServicesA;
public ServiceController scTempB;
public ServiceController scTempA;
public Form1()
{
InitializeComponent();
scServicesA = ServiceController.GetServices();
int cuentaA = 0;
clbA.Items.Clear();
clbB.Items.Clear();
foreach (ServiceController scTempA in scServicesA)
{
cuentaA += 1;
clbA.Items.Add(scTempA.DisplayName + " (" + scTempA.ServiceName + ")" + "\r\n");
}
Timer tmr = new Timer();
tmr.Interval = 3000;
tmr.Enabled = true;
tmr.Tick += new EventHandler(tmr_tick);
lblCuentaA.Text = cuentaA.ToString();
}
public int cuentaB;
public void tmr_tick(object sender, EventArgs e)
{
clbB.Items.Clear();
cuentaB = 0;
ServiceController[] scServicesB;
scServicesB = ServiceController.GetServices();
foreach (ServiceController scTempB in scServicesB)
{
clbB.Items.Add(scTempB.DisplayName + " (" + scTempB.ServiceName + ")" + "\r\n");
cuentaB += 1; }
lblCuentaB.Text = cuentaB.ToString();
if (scServicesA.Equals(scServicesB)) MessageBox.Show("Son IGUALES");
else MessageBox.Show("Son DISTINTOS");
}
}
Thanks,
Fernando
|
|
|
|
|
Well, scServicesB and scServicesA are both arrays. They will never be equal because they are distinct object. Are you trying to compare the elements in those arrays for equality?
|
|
|
|
|
Yes, I want to compare the values, no the references. I get the services, and write they in scServiceA (imagine 2 services, serviceone and servicetwo). After 5 minutes I get the services again, but write they in scServiceB, and compare scServiceA and scServiceB for know what serviceone and servicetwo are.
Thanks,
Fernando
|
|
|
|
|
Why not just compare the elements? Something like:
if(scServiceA[0] == scScerviceB[0] && scService[1] == scServiceB[1])
{
}
Is that what you're trying to do?
|
|
|
|
|
Hey guys,
I'm looking an object which monitors my CD drive. If a disc is inserted, needs to check wether this disc is an audio disc or not. If so, it should also be able to count the audio tracks in disc. I've found one object, but it locks the drive in a nasty way! When a insert a data disc, the data will not be available until i shut my app. down (even when the CD monitor object is disposed!) so I obviously want to get rid of that object and write my own. I'm pretty unexperienced in readin audio discs though, i meight require a little help. Any of you guys know a good article or example to build on? I couldn't find any article on codeproject which doesn't contain fancy code like ripping and so. I only need to 'see' what kind of disc is in the drive, nothing more, nothing less...
Thnx! Eduard
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
Hrmm, I've been mudding around and created a component which monitors the CD Drives and fires events as they become ready, and when they become unavailable. I've even managed to determine wether the disc as an audio disc or a data disc ( haven't checked mixed yet ). Now i'm stuck on counting the number of audio tracks. Anyone knows a piece of code for that?
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
Hi
I develpoed my project (mdi/child form) in 1024*768 resolution mode.
Now when i run it in 800*600 mode , it looks terrible, because i set controls position programmatically.
What are you doing to avoid this problem?
What properties of form and controls i should set?
Somebody says you should develope your project in 800*600 mode, then in inceasing monitor resoultion, no problem accures.
Please help me and show the best and professional way.
Tanx for your help.
|
|
|
|
|
freshonlineMax wrote: What are you doing to avoid this problem?
I use the designer, then set the anchor and dock properties so that they resize themselves nicely
freshonlineMax wrote: Somebody says you should develope your project in 800*600 mode, then in inceasing monitor resoultion, no problem accures.
There could be something in that, it means your form works well in it's minimum size.
|
|
|
|
|
Hi
May be you are the right one who can help me in this topic.
Dear Christian
I have a button in my panel control, when i set the dock propertie, the button goes to left or top or ... but i want to keep the button in it's custom position,
I can't work with "Anchor" and "Dock" properties, how you start a simple application without resizing problem?
Please mail me a simple project if you can (Sorry!), with just a panel and a button in middle of panel to show me how setting these properties causes to resizing controls in screen resolution change automatically.
Tank you.
|
|
|
|
|
Hi All,
Can anyone let me know how I can validate the textbox for allowing only numeric charcters and restricting special characters.
Thank you!
Sincerely,
Deepa!
|
|
|
|
|
Hi
I use below method :
public bool isNumberSymbol(char KeyChar)
{
bool state=false ;
if (KeyChar > 31 && (KeyChar < '0' || KeyChar > '9'))
state = true;
return (state) ;
}
private void AiTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = isNumberSymbol(e.KeyChar);
}
For any problem contact me.
Regards.
|
|
|
|
|
Use event KeyPress from textbox, and write something like this in eventhandler:
if (char.IsNumber(e.KeyChar) || e.KeyChar == (char) Keys.Back)
{
e.Handled = false;
}
else
{
e.Handled = true;
}
This sample of code allows only numeric and backspace in textbox.
|
|
|
|