|
Additionally to what teejayem said: if you want to modify the textboxes of your form, then you can do this:
foreach(Control c in this.Controls)
{
if(c is TextBox)
((TextBox)c).Text = insert_your_text_here;
}
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thank you a lot, your aid was really helpful
Ivan
|
|
|
|
|
Hi there.
I have a XML file like this :
<NODE15>
<BOOKMARK16 NAME="Mozilla - Home" HREF="http://en-us.www.mozilla.com/en-US/" />
<BOOKMARK18 NAME="mozillaZine Forums" HREF="http://forums.mozillazine.org/index.php" />
<BOOKMARK19 NAME="Mozilla Support" />
<BOOKMARK20 HREF="http://www.download.com/" />
<BOOKMARK21 HREF="http://firefoxplanet.ir/" />
<BOOKMARK22 HREF="http://developer.mozilla.org/en/docs/Extensions" />
<BOOKMARK23 HREF="http://forums.mozillazine.org/viewforum.php?f19" />
<BOOKMARK24 HREF="https://addons.mozilla.org/en-US/firefox/addon/5229" />
</NODE15>
I want to search in it by LINQ.
I used this code
X_Element = XElement.Load(FileName);
var searchNodes = from nodes in X_Element.Descendants()
where Regex.IsMatch(nodes.Attribute("HREF").Value, "Mozilla", RegexOptions.IgnoreCase)
select nodes;
But there is no data in searchNodes
What's wrong with it ?
Thanks in advance
|
|
|
|
|
Please don't crosspost.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi
I have a custom control which encapsulates a dropdownlist and label.
when you select an item from the dropdownlist it should autopostback
and change the lable text. But postback (selectionchanged) event is
not working at all.
Here is my code.
protected override void RenderContents(HtmlTextWriter output)
{
this.buildControl(output);
}
private void buildControl(HtmlTextWriter output)
{
Table currencyConverterTable = new Table();
// add a label
// here I am adding a dropdownlist
dropdownlist currencySelector= new dropdownlist();
currencySelector.DataSource = mydatasource;
currencySelector.DataTextField = "CurrencyCode";
currencySelector.DataValueField = "id";
currencySelector.DataBind();
currencySelector.AutoPostBack = true;
currencySelector.SelectedIndexChanged += new
EventHandler(OnSelectedChanged);
// add this dropdownlist to the table
// now render it
currencyConverterTable.RenderControl(output);
}
Shouldn't OnSelectedChanged event be fired?
Thanks,
Toby
|
|
|
|
|
Is the BinaryWriter basically functions the same as the StreamWriter??? Can some give me a brief explanation on each? (believe me I did research, and 0% knowledge from what I have read)
|
|
|
|
|
StreamWriter is designed to write strings (essentially, you will use it to write text files).
BinaryWriter is used to write raw bytes to a file (say you were writing a wav file).
|
|
|
|
|
Seeking help with
(i) method/ c# code to remove every second item in a queue
I tried front.next = front.next.next but it this is removing only one second item just after the first but would like to remove every other second item/element through out the queue.
(ii) c# code for reversing a queue .
|
|
|
|
|
(ii)
A queue is a first in first out type right?
So take a queue that you want reversed and put it into a stack.
Then move the stack to a new queue.
This will reverse the queue.
|
|
|
|
|
How do I put all that into C# code?
|
|
|
|
|
This sounds like a homework problem. Even if someone here did it for you, you still wouldn't be able to do future (and harder!) problems.
Use an easy problem like this to develop your programming skills. Figure out the procedure you'd use to solve this with pen and paper. Then figure out how to implement this algorithm with C#.
|
|
|
|
|
Hi,
I have a textbox and i want to set focus to a particular row in the datagridview.
The row that i want is not the index row(that i know) but the row that has a particular id(column name here)
id first_name last_name
1 nelson paixao <-----index0
4 helen hunter <-----index1
5 mark berger <-----index2
7 seth mayer <-----index3
...
private void ToolStripTextBox_Row_TextChanged(object sender, EventArgs e){// code here}
This is a design issue not very important to me but,
Can anyone help me here?
nelsonpaixao@yahoo.com.br
|
|
|
|
|
Is it possible to read a cookie that a website has created or write a cookie that the same website can use? I mean outside of the website itself? It's my own web site, by the way. I know the names and keys inside it and where it is stored already.
Thanks
Brent
|
|
|
|
|
Hey
I'm new to working with c# and am creating a desktop application which needs to store the source code of html files in a mssql database but i keep getting an error
Incorrect syntax near '<'.
Iv tried using SecurityElement.Escape(theSourceCode) but i get the same error only referencing a '&'
I'm hoping this will be an easy question for some one with a bit of exsperience in c# but is there a function to remove or encode the sql sensitive characters from the string containing the source code
Thanks in advance
Phil
|
|
|
|
|
So, show us your code and we can then see what you are doing wrong.
|
|
|
|
|
phil_mob wrote: is there a function to remove or encode the sql sensitive characters from the string containing the source code
Yes. Use a parameterised query, then the value is escaped automatically.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
"system.formatexception: datagridviewcomboboxcell value is not valid"
DataTypes are correct, it selects the right data too. The selections are pulled from one table, the actual selected value is pulled from another.
Any ideas?
|
|
|
|
|
<scarcasm>
Millions not that you'd be interested.
</scarcasm>
hopefully someone will know where that line came from.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
I am trying to get the Expiration Date from a card. Sending the following APDU command I get a bunch of data back in the response with a status code of 9000. CLA=00 INS=A4 P1=04 P2=00 LC=00 LE=00. As for getting the Expiration Date I am completely lost. A document I have here says the Expiration Date is in the tag 0x35. Should I be using the SELECT or GETDATA command for this? Where does the tag 0x35 come in?
Thanks,
|
|
|
|
|
...huh?
"I need build Skynet. Plz send code"
|
|
|
|
|
I have a quick question for anyone who knows the answer to this:
Is there a difference (either performance or otherwise) between the following:
myObject.SomeEvent += new EventHandler(HandlingMethod);
and
myObject.SomeEvent += HandlingMethod;
Thanks
Steve
|
|
|
|
|
One is correct and the other isn't. You need to do the '+= new EventHandler' for non-anonymous methods. To unsubscribe from events you can use the -= .
Regards,
Thomas Stockwell
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.
Visit my Blog
|
|
|
|
|
The short answer is no, they are equivalent. A slightly longer answer is that the compiler recognises from the context that the second version requires the new EventHandler(...) and generates the same code for both.
For a really detailed answer take a look at a copy of Jeff Richter's "CLR via C#". But I warn you, that may tell you more than you wanted to know!
Alan.
|
|
|
|
|
Thanks. I guessed that was what would happen but wanted clarification.
|
|
|
|