|
I think this will help U
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("gender.xml"));
DataTable dt = ds.Tables["family"];
DataRow dr;
for (int i = 0; dt.Rows.Count > i; i++)
{
dr = dt.Rows[i];
String firstNameValue = dr["firstname"].ToString();
String lastNameValue =dr["lastname"].ToString();
Lblmsg.Text=" FirstName: "+firstNameValue + " LastName: " + lastNameValue;
}
Jintal Patel
|
|
|
|
|
i think XQuery will help u out
XQuery is to XML what SQL is to database tables.
http://www.w3schools.com/xquery/xquery_intro.asp
|
|
|
|
|
I got the code......
string str;
XmlTextReader reader = new XmlTextReader ("D:\\Foldername\\tx1.xml");
try
{
while (reader.Read())
{
if(reader.IsStartElement() )
{
if (reader.NodeType == XmlNodeType.Element && reader.Name == "jid")
{
str=reader.ReadString();
//Lblmsg.Text="Article Title is : "+ reader.Name+ " : "+reader.ReadString();
Lblmsg.Text="Article Title is : "+ reader.Name+ " : "+str;
lblcnt.Text=str;
}
}
}
reader.Close();
}
catch (Exception err )
{
Lblmsg.Text="Error: " + err.ToString();
}
Thanks for the help....................
|
|
|
|
|
Dudez,
Is there a way to save the username and password when user login.
Example:
I will access computer name \\ROBO then username and password form pop up.Think on computer neighborhood. When that user input his/her username and password. It will save on temporary file. Is it possible? How to do that? Much better if you can give a link or an existing application that can be downloaded (3rd party).
Thanks in advance,
jeof
******************************
I just want to
know everything
|
|
|
|
|
You can store any info you like, whereever you like. Storing passwords is obviously sensitive, however.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi I'm posting a new question in case Malcolm doesn't read my reply in time.
Basically what is wrong with this code? I want to automatically check the checklistbox items depending on if the items match the employees TechnicalSkillsID in the database table. Malcolm gave me a web form example which was a great response except I forgot to tell him I was using a winform.
can you help at all?
int i;<br />
<br />
for (i = 0; i <= (techSkillsCheckListBox2.Items.Count - 1); i++)<br />
{<br />
while (adoDR.Read())<br />
{<br />
sql = "Select em.TechnicalSkillsID,t.ProgLanguagesDatabase from EmpSkills em,TechnicalSkills t where EmployeeID = '" + FirstnameText.Text + "' and em.TechnicalSkillsID = t.TechnicalSkillsID";<br />
<br />
DataRow[] rows = dataSet1.TechnicalSkills.Select();<br />
foreach (DataRow row in rows)<br />
{<br />
string techID = row["TechnicalSkillsID"].ToString();<br />
techSkillsCheckListBox2.SetItemChecked(i, true);<br />
}<br />
}<br />
}
Sianny aka Sharny
|
|
|
|
|
falles01 wrote: for (i = 0; i <= (techSkillsCheckListBox2.Items.Count - 1); i++)
Why not
i < techSkillsCheckListBox2.Items.Count ?
Or even
foreach (CheckBox box in techSkillsCheckListBox2.Items) ?
This code is really broken. What you want to do, is fill a list with the items that are selected, then go through each check box and do something like
checkbox.Checked = (myListOfItems.Contains(theKEyForThisCheckbox));
Of course, I just invented some variables, assume the Tag of the checkbox contains the key value, so you can look it up. The code you're presenting does a nested loop, and just sets each box to be checked, over and over again.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks but the part you are talking about that is wrong, is actually the part that is correct and gives the correct value. I got that off msdn. Yes I want to fill a list with items but as i said, I can't use listitems as I'm using a winform so I would like to know how I do that exactly. How do you check the items against the ID's against an empID in the database?
Sianny aka Sharny
|
|
|
|
|
If you have a list of items and want to fill the control with them, you should be able to set the control's DataSource property with the list, and it should work.
That code is from MSDN ? It's REALLY messy, especially with the nested loop. Do you have a link ? I believe you, I'm just interested.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I'm not sure what you mean but i think I have filled the list already as you said as the items are there. I just need the ticked items to save as correct ID's in the database against a given employee. I would've used bits and pieces of msdn stuff so that might be why its messy. I didn't copy a whole paragraph of code, just a line here and there.
<br />
public override void TechnicalSkillsList()<br />
{<br />
<br />
DataSet1TableAdapters.TechnicalSkillsTableAdapter technicalskillsTableAdapter = new ResourceSearchTool.DataSet1TableAdapters.TechnicalSkillsTableAdapter();<br />
<br />
DataSet1.TechnicalSkillsDataTable techSkillsDT = technicalskillsTableAdapter.GetData();<br />
<br />
foreach (DataSet1.TechnicalSkillsRow techSkillsRow in techSkillsDT.Rows)<br />
this.techSkillsCheckListBox2.Items.Add(techSkillsRow.ProgLanguagesDatabase);<br />
<br />
}
|
|
|
|
|
and how do you fill a list with the checked items by the way?
|
|
|
|
|
and what sort of list? I have a checkedlist box which is filled with data from the dataset.
|
|
|
|
|
Hey,
I am trying to draw a line on a bitmap. I have tried using System.Drawing.Graphics, however this apparently only works with forms. When I try the following code:
System.Drawing.Graphics.DrawLine(drawerpen, lastpoint, currentpoint);
I get an error saying that I must create an object instance to use this. However, System.Drawing.Graphics has no constructors, so I cannot create an instance such as:
System.Drawing.Graphics lineDrawer = new System.Drawing.Graphics();
How can I draw lines on a bitmap?
|
|
|
|
|
Klazen wrote: however this apparently only works with forms.
What makes you say that ?
Klazen wrote: I get an error saying that I must create an object instance to use this
Yes.
Klazen wrote: How can I draw lines on a bitmap?
Graphics graphics = Graphics.FromBitmap(myBitmap);
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you very much
I say that because the only working instance of Graphics I found was through a form, such as using it to draw lines on a form.
|
|
|
|
|
Ah, sure, because in the paint event, it's been created for you.
A lot of .NET classes use static factory methods instead of constructors, that's always something that's good to look for, in that scenario.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello comrades !!! I need your help. Here is what we have:
We have a jpg image that contains gray background and a lot of white eggs on it. We need to get the number of eggs and the size of each eggs. (i think in pixels).
How can i do it ?
The hardest problem is to get the whole egg (To mark the edges) and smart divide screen into some parts, for easiest count.
Thanks for help.
One nation - underground
|
|
|
|
|
Sounds like a school question. You'll never learn by immediately hoping on the forums and asking such a broad question. Instead start writing code and when you hit smaller stumbling blocks along the way, then we can help!
|
|
|
|
|
Interesting problem. Probably a lot easier than you think, however. Start with my image processing articles, for how to access the pixels of a bitmap. Then, just think it through.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello!
I have a question: I want to send signals from my pc to a µC via Ethernet!
PC sends signal via ethernet to a ethernet/RS232 changer and then to the µC!
I have problems to understand how to speak with the changer...
What should I look for?
Had someone the problem before?
Thanks!
|
|
|
|
|
Your only hope is documentation on the RS232/Ethernet changer or an SDK. Your single best source of information would be the manufacturer of the device. This is so non-standard, it's very unlikely you'll find someone who has done it.
|
|
|
|
|
Hi,
basically an Ethernet-to-RS232C converter consists of a cable and a driver
(same is true for a USB-to-RS232C converter).
when installed properly the cable+driver turn the new RS232C plug into a regular serial
interface; you should be able to see it in the list of available ports, e.g. in a terminal
emulator program such as HyperTerminal.
And you should also be able to use the SerialPort class to access that serial port in
exactly the same way you would access a regular serial port (assuming your PC still has one).
The conclusion is: you never "speak" to your converter, its driver makes it fully transparant.
Hope this helps.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hmmm...I've never heard of these little things, and frankly, can only think of a couple of reasons to even use one.
Learn somet'in new every day...
|
|
|
|
|
Hi!
What is the best way of determining the TopMost and BottomMost visible rows in the datagrid (.NET 1.1)
Thanks
|
|
|
|
|
Hi,
I have a TextBox, and DataGrid on a form. TextBox has the focus, by pressing the PageDown key while in TextBox, I want the DataGrid to perform the PageDown functionality.
I know that I have to use SendMessage method, I am just no sure what parameters I have to pass for the Pagedown handler.
Any ideas?
Thank you.
|
|
|
|