|
Hey,
i know i use addsource but u know what happen is ??
suppose i have 4 records in my resource file and when i add new record programetically at that time it will erase previous 4 records and add new i records so right now i have only one records in my resource file. so understand it will not append the records.
i know its my mistake in asking question but from now do not use this kind of words ok..
and if u don't know then do not reply with this kind of words understand.
Rana Krishnraj
|
|
|
|
|
The very, very basic process of changing an element in an array:
resource["text"] = "test 123";
|
|
|
|
|
Doing a little googling I find that you have done two things wrong.
First you defined your FileStream wrong. You have it set of Create or Open and do not have it set for ReadWrite
Next you are only using AddResource for everything. Look at AddResourceData.
If none of those help then you are SOL. And while you may not like what I say, I do not like jobs stolen by cheap Indian labor and then having the same job theives coming here begging us to write their code for them or help them become programmers.
|
|
|
|
|
OK Now don't explain me in air ok. Doing a little googling is not enough ok and one more thing when u make an object of ResXResourceWriter and after that try yo find object's associated methode. there is no any kind of methode that u specufy - AddResourceData() understand u SOL.
any way i already implement it. From now don't reply to any body with this kind of words understand u Bhenchode..
Rana Krishnraj
|
|
|
|
|
|
protected void btnright_Click(object sender, EventArgs e)
{
ListItemCollection listnameitems = lstboxnames.Items;
foreach(ListItem itmname in listnameitems)
{
if (itmname.Selected == true)
{
lstboxphone.Items.Add(itmname.Text);
listnameitems.Remove(itmname);
}
}
}
this is my code to select list box items of one listbox to other listbox.the items must get removed from the listbox where the items are added from.
The add method is working but when i remove the items it is showing a msg box with "collection was modified enumeration may not execute ".
Can any one help where iam doing mistake.
|
|
|
|
|
Exactly what the error says. You cannot modify a collection you are using foreach on. So, you need to use a for loop, or you need to collect items to modify and modify them outside the loop.
List<ListItem> remove = new List<ListItem>();
foreach(ListItem itmname in listnameitems)
{
if (itmname.Selected == true)
{
lstboxphone.Items.Add(itmname.Text);
remove.Add(itmname);
}
}
// now iterate over remove, and remove them.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
does i need to include any namespaces?
The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)
foreach statement cannot operate on variables of type 'System.Web.UI.WebControls.ListBox' because 'System.Web.UI.WebControls.ListBox' does not contain a public definition for 'GetEnumerator'
the above errors are listed when i execute code using ur reply.thanku
|
|
|
|
|
its ok i have done with for loop.
but if any other answer using for each reply me.
Thank u
|
|
|
|
|
System.Collections.Generic. VS2005 will show you missing namespaces, just put the arrow near the bottom right of the word and an arrow appears, which will add a using statement or scope it explicitly for you.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
There's a much more elegant way to do this if the collection has RemoveAll
listnameitems.RemoveAll( delegate(ListItem itemName) { return itemName.Selected; } );
This avoids creating a temporary list, adding items to it and then iterating over it and removing items from the original list.
|
|
|
|
|
Guys need help man
How to convert this vb code
officer.Text = mid(User.Identity.Name, instr(User.Identity.Name, "\")+1, len(User.Identity.Name))
to C Sharp
Thanks A million
KaKaShi HaTaKe
|
|
|
|
|
Hi,
Here is yr c# code.
officer.Text == Strings.mid(User.Identity.Name, Strings.instr(User.Identity.Name, "\\") + 1, Strings.len(User.Identity.Name))
I hope it will help u..
Rana Krishnraj
|
|
|
|
|
Krishnraj,
I don't think it will help him, since it wont work in C#.
Regards,
Gareth.
|
|
|
|
|
|
There are several websites that translate code from Vb to C# or the other way around. Google will help you in finding them if you ask it.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
This is what happens when people use nasty legacy VB stuff.
I think mid is replaced by Substring, instr is replaced by FirstIndexOf and len is replaced by Length, all members of teh string class.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
(via Instant C#):
officer.Text = User.Identity.Name.Substring((User.Identity.Name.IndexOf("\\", 0) + 1), User.Identity.Name.Length);
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
Java to VB & C# Converter: convert Java to VB or C#
|
|
|
|
|
Hi all,
I need open .doc file using richtextbox.I use openfileDialog command to open .doc file.The error was "file format is not valid"..
I had draw some object in .doc file..Is it the problem because of it..?
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
|
|
|
|
|
richtextbox cannot open word docs.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Are you able to save the doc file as an RTF? I believe richtextbox can handle that.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Ya i can save .doc file in .rtf format..Nw i can open .rtf file using richtextbox..I drew rectangle using wordpad then save in .rtf format..
Now the problem was, i cant change the rectangle colour inside richtextbox.
So how i can change the rectangle colour.?
%#&kmpYrlHSGYG5@#($_+!@!(*JASnjshdk,cm_0ashjhdbn@#$!48mkhfbchsh))^%#W%&@YW7wsdfjw789';'][]\`~JKJQ4$!@#~)-HSKS^&*1)JK12@#@$~!1`DFGkqp][]\]?Zas;EWRG%!@~)(^&BVAG
|
|
|
|
|
RichTextBox can display rtf files, not doc. There are several controls here on codeproject that allow to display doc files. Search and you'll find them
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
Hi,
I'm trying to create a function that will automaticly send me the errors of the application using the MailMessage function from the namespace: System.Net.Mail.
This is the code I have now but for some reason it aint working.
It gives me the following error (sorry it's in dutch):
"Postbus niet beschrikbaar. Het serverantwoord is: 5.7.1 Unable to relay for email@company.nl"
try
{
MailMessage message = new MailMessage();
message.From = new MailAddress("info@company.nl", "Application AutoEmail", System.Text.Encoding.UTF8);
message.To.Add(new MailAddress("email@company.nl"));
message.Subject = "Application error";
message.Body = "This is the content...";
message.Priority = MailPriority.Normal;
SmtpClient client = new SmtpClient();
client.Host = "localhost";
client.Port = 25;
client.Send(message);
MessageBox.Show("Your email has succesfully been send.", "Email send");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error");
}
What am I doing wrong?
|
|
|
|
|
Your local SMTP server is not set up correctly.
|
|
|
|