|
thanks for the reply Paul ...it would be great if you could explain the technique to me as i am a novice in the field of C#.Net programming
|
|
|
|
|
Do a basic google search for Office Interop Library, also, check out the link John just posted.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
|
I don't know what happened, your post should have gone to the OP, and for some reason came up in my email Good link, and I directed the OP to your post.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Another way can be using OloeDB classes. You can connect to the excel file and perform insert.
|
|
|
|
|
I have a string stored in a variable, say
myString= <RssFeeds><link>http://www.codeguru.com/icom_includes/feeds/codeguru/rss-all.xml</link>
<title>CodeGuru.com</title>
<description>something</description></RssFeeds>
<RssFeeds>
<link>http://lifehacker.com/index.xml</link>
<title>Lifehacker</title>
<description>something</description></RssFeeds>
I want to extract the text between <link> and </link> and also the text between <title> and </title> in two different arrays.
How to do this, please help me. if anyone have code or any helpfull link please reply back.
Thanks
|
|
|
|
|
You could alway use regular expressions.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Try using this way
string myString = "<rssfeeds>http://www.codeguru.com/icom_includes/feeds/codeguru/rss-all.xml"
+ "<title>CodeGuru.com<description>something<rssfeeds>"
+ "http://lifehacker.com/index.xml<title>Lifehacker<description>something";
string[] test = new string[15];
myString = myString.Replace("", "#");
myString = myString.Replace("", "#");
test = myString.Split(Convert.ToChar("#"));
|
|
|
|
|
I want to extract substring and store it in an array from to , it repeats two times in my string. How to extract it?
|
|
|
|
|
You can doing it with using for loop.Check '<' in string array if array is not contain that than store that sting with ++
|
|
|
|
|
Dirty but seems to work.
string sFull = "this the is test for the true";
string sToSearch = "the";
int iFirst = sFull.IndexOf(sToSearch);
int iSecond = sFull.IndexOf(sToSearch, iFirst + sToSearch.Length);
string sText = sFull.Substring(iFirst + sToSearch.Length, iSecond - iFirst -sToSearch.Length);
|
|
|
|
|
Thats not a string, its called "Xml" and there is built in ability to read its node values.
Have a look at System.Xml.XmlDocument and System.Xml.XmlTextReader
|
|
|
|
|
|
I have a form that can optionally display several MDI children forms. I have a toolbar that when clicked, I'd like to make the child visible and bring it to the front. If the child is already visible but not in the front, I'd like to bring it to the front. Finally, if the child is visible and in the front I would like to hide the child until the button is pressed again.
I have no problem showing/hiding or bringing the form to the front, but I don't know how to determine which form is on top. Any ideas on how to do this?
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
how to add date time picker for wpf application.please help.
|
|
|
|
|
this is C# Forum. please put it on WPF Forum
cheers,
Abhijit
|
|
|
|
|
|
This is a feature I've seen with the picture control on VB, but could I do that with text boxes or buttons on C#?
I´m trying to change some properties of textboxes but I want to use iteration. For instance, I want to assign the for cycle counter's value to each textbox and display it. 1 for textbox1.text, 2 for textbox2.text and so on.
If anybody has another method to do this please tell me.
I hope made myself clear and excuse my english.
Regards
Ivan
|
|
|
|
|
You can create an array of pretty much any type (in your case text boxes).
Note: Pseudo Code
TextBox[] myTextBoxes = new TextBox[5]
for(int index = 0; index < myTextBoxes.Length; index++)
{
myTextBoxes[index] = new TextBox();
myTextBoxes[index].Text = String.Format("TextBox #{0}", index+1);
}
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
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)
|
|
|
|