|
-Electronics
-TV
-Screen
58 CM
62 CM
68 CM
-Stereo
-withFm
-Washing
-washingMachine
-drymachine
Here are 4 levels but this could be any number of levels. What we want is to display this in tree view (+, -).
Following is the sample database.
articleID(auto incrementID) parentArticleId articleName status
1 0 Electronics A
2 0 Washing A
3 1 TV A
4 1 Stereo A
5 2 washingMachine A
6 2 dryMaching A
7 3 Screen A
8 7 58 cm A
9 7 62 Cm A
10 7 68cm A
11 4 With Fm A
This is the explanation of the requirement.
Regards,
rahul saini
|
|
|
|
|
here is simple code :
if (objReader["parentArticleId"] == 0)
TV.Nodes.Add(objReader["articleId"].ToString(), objReader["articleName"].ToString());
else
{
TreeNode[] findNode = TV.Nodes.Find(objReader["articleId"].ToString(), true);
findNode[0].Nodes.Add(objReader["articleId"].ToString(), objReader["articleName"].ToString());
}
hope it will work
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi,
I wanted to find out the user name of the application.
Example: user name: rozhanin
I looked up on the net and i find answers which return the login name (dz2344).
I used the Active Directory and was able to find out the name (rozhanin), but this does not work on some computers.
Is there any other method to find the user name.
your help will be greatly appreciated.
Thanks!!
|
|
|
|
|
Hello,
If u r using Window Application than u may use SystemInformation. Like --
SystemInformation.UserName
Please reply.
Best of Luck.
Dipak
|
|
|
|
|
Hi Dipak,
Like i told you by using SystemInformation.UserName gives me the login id(example: dz1234) on the network. I wanted to find the name of the person with this login id (example: rozhanin).
I could achieve this by using InterOp.ActiveDs.dll, but this does not work on some computers. Is there any other method to find the Name of the user given the login id??
Thanks for your reply ,
rozhanin.
|
|
|
|
|
Hi! all.Right now m making a win Email application.I need to create a user interface and so users can select the recipients from Exchange Server Address Book, so user can send e-mail with attachment to the recipients in web application. so, anybody have any idea about that.i need a sample so i can use it in my project.
thanks..
|
|
|
|
|
Hi all,
I already convert a C++ project to C# project. It's fine and working ok.
On C++ I use DWORD data type. But in C# for that I used just a int value. Is that ok. Is there compatible data type which I can use for my project.
Thanks.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Are you having an issue, or are you just worried in general ? long is bigger than int in C#.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Actually I worried this because it related with registry. So new value type should be compatible with registry data type REG_DWORD
I appreciate your help all the time...
Eranga
|
|
|
|
|
UInt32 or Int32 are equivalent to DWORD in c#.
|
|
|
|
|
Seems it is fine. Thanks a lot.
At the same time I found one thing. bool type variable gives the same output as DWORD. Do you guys know about it?
I appreciate your help all the time...
Eranga
|
|
|
|
|
I have a panel control contain 3 label on these labels i am using barcode font Code 39 now i want to print these barcode but i am unable to do so..
Can any one give me a code to print these barcodes.
|
|
|
|
|
Use DrawToBitmap method of control to draw image of control on a bitmap object.
After this you may use a PrintDocument and PrintPreviewControl and you may draw this bitmap image on PrintDocument using PrintPage event.
-Dave.
Dave Traister,
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi,
Does anyone have code that will communicate to the USB port to send and receive data in C#.
Thanks in advance,
Praji
|
|
|
|
|
|
|
Hi all,
In the form load of a text box, I want to display a value from the registry. So I try this in InitializeComponent() as follows.
namespace ServerStarter
{
public class Form1 : System.Windows.Forms.Form
{
private RegistryKey regKey =
Registry.LocalMachine.OpenSubKey( "SOFTWARE\\Test\\MyTest", true );
private void InitializeComponent()
{
this.textBox1.Text = regKey.GetValue("server");
}
}
}
Here server is one of the value in my regKey registry sub key. This code gives an error
F:\Projects\FocusGroupServer\ServerStarter\Form1.cs(467): Cannot
implicitly convert type 'object' to 'string'
can you tell me where I'm going wrong.
Thanks.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Ok, I found where I'm going wrong with my code. I have to use them as a string.
So,
this.textBox1.Text = regKey.GetValue("server").ToString();
This works for me fine, in form load the correct value is displayed on the text box. But gives a warning says
The variable 'regKey' is either undeclared or was never assigned.
And also I found one funny thing. Suddenly after doing some design modification, the textBox1 text set to empty as
this.textBox1.Text = "";
This is happened automatically. Why is that. In compile time I don't get any error at all. I'm really worried about it....
I appreciate your help all the time...
Eranga
|
|
|
|
|
hello friend,
u may combine your code and donot need to store value on a variable like regkey. Like this :
TextBox1.Text = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Test\\MyTest", true).GetValue("server").ToString();
OK.
Reply.
Best of Luck.
Dipak
|
|
|
|
|
Initially I though about it, but not tested. Because say I put more texboxes later, say all together there is 5 boxes. So I have open a same registry key 5 time. Is that ok.
After the line
dipak.dipak wrote: TextBox1.Text = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Test\\MyTest", true).GetValue("server").ToString();
I can't do,
Registry.LocalMachine.OpenSubKey("SOFTWARE\\Test\\MyTest", true).Close();
because such logics are not allowed in InitializeComponent(), isn't it?
I appreciate your help all the time...
Eranga
|
|
|
|
|
Yeah, u r right. If u didnot initialize that component than why r u going to close?
As u said : "put more texboxes later, say all together there is 5 boxes. So I have open a same registry key 5 time."
than u may retrive the registry value once and store in a String variable and set text of other textboxes.
String strRegVal = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Test\\MyTest", true).GetValue("server").ToString();
TextBox1.Text = strRegVal;
TextBox2.Text = strRegVal;
TextBox3.Text = strRegVal;
TextBox4.Text = strRegVal;
TextBox5.Text = strRegVal;
Is it OK as u want?
Best of Luck.
Dipak
|
|
|
|
|
Yes it's true. But I'm still wired on it pal. Say I want to display five different registry values, that mean I have five different names. So I have to use five sub keys in your way. Isn't it?
By the way I tried one way. As usual write a separate function to set the initial values on to text boxes and call that function in form load. What you think of it. There is no any warnings either.
I appreciate your help all the time...
Eranga
|
|
|
|
|
CodingLover wrote: the textBox1 text set to empty... This is happened automatically
You really shouldn't do this in the InitializeComponent method as it's likely to get erased. It's safe to hardcode a value in there i.e. this.textBox1.Text = "Initial Text"; .
When you modify your form in the designer, let's say you add a text box, the VS rewrites the InitializeComponent adding your new text box to it and setting some basic property values. It does the same anytime you modify a property in the designer. When it does this, the whole method is rewritten and any changes you made will most likely get erased in the process.
Before the InitializeComponent method there is this to warn you:
#region Windows Form Designer generated code
You should put your code either in the constructor after the call to InitializeComponent, or better still, in a seperate method to be called afterwards.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
OtherInitializations();
}
private void OtherInitializations()
{
this.textBox1.Text = regKey.GetValue("server").ToString();
}
}
Dave
|
|
|
|
|
Yes,
That's what I have done on my last post. As far as I feel, I can edit only the initial properties of controls, without using the Properties window.
Only I can't put any logic there. Isn't it.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Yes, that's correct. Any properties that can be set in the properties window AND the values that can be entered there will be OK. Anything else you should do in your own method or in the constructor AFTER InitializeComponent
Dave
|
|
|
|