|
I meant I'd show the user a message, not throw an error
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 )
|
|
|
|
|
^[abAB]{1}.*$ This expression matches with all the words starting with a and b. Use this pattern with Regex class and check for a match. If no match found, throw an error. Also you may check this[^] article which explain writing rules to your business objects and binding the error provider to the control. It can make life more easy.
|
|
|
|
|
if (!txtboxHolderRef.Text.Lenght.Equals(11))
{
throw your error and return
}
else
{
String StartLetter = txtboxHolderRef.Text.Substring(1,1)
switch (StartLetter)
{
case "A": do something; break;
case "B": do some other thing; break;
default: break;
}
}
|
|
|
|
|
Hello,
I am coping contents of DataReader in to ArrayList and bind this ArrayList to dropdownlist1.Now i want to remove the item from my arraylist which has been selected by dropdownlist1,after deleting d item i want to bind the updated arraylist to the another dropdownlist and so on. My code looks like following....
item = new ArrayList();
conn.Open();
string qitem = " SELECT DESCRIPION FROM ITEM_MASTER ORDER BY DESCRIPION";
OracleCommand ocmd = new OracleCommand(qitem, conn);
OracleDataReader odr = ocmd.ExecuteReader();
if (odr.HasRows)
{
while (odr.Read())
{
item.Add(odr.GetString(0));
}
}
odr.Close();
conn.Close();
bind_control(ddl_mainItem, item);
Now i want to delete item selected by ddl_mainItem.What can I do?
Plz help me.....
|
|
|
|
|
Why are you still using .NET 1.1, and if you're not, why are you using arraylist ?
The List class certainly has an items collection which has a remove method, I believe ArrayList does, too.
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 )
|
|
|
|
|
Hi,
i'm Merging To DataTables Into 1
They are in same format , so far so good it's Doing it well
But When i'm trying to Update To The DataBase Nothing is Actually Done
No Saving of the Data.
This Is The Code :
<br />
dS_M_ICD.Interface_Details.Merge(dS_E_ICD.Interface_Details, true);<br />
<br />
M_Interface_D.Update(dS_M_ICD.Interface_Details);<br />
dS_M_ICD.Interface_Details.AcceptChanges();<br />
<br />
Have Fun
Never forget it
|
|
|
|
|
i want to apply the encription and decription on my data files by using c#. how can i do this in c#
|
|
|
|
|
The Cryptography namespace is full of algorithms you can use, and google abounds with examples on how to use 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 )
|
|
|
|
|
Hi,
How to retrieve records from Excel Sheet..Its working fine when i have a column name in the Excel sheet, if suppose i didnt have the column name. i have to retrive record in the basis of column index..how can i acheive this one.. im using C#.net 2003..
Regards
Kanna
|
|
|
|
|
Hello!
I´ve got this regular expression:
Regex.Replace(amount.Value.ToString(), @"(?<=^-?\d+)(?=\d{3}$)", ".")
it takes a value and returns it formated like this:
1 -> 1<br />
12 -> 12<br />
123 -> 123<br />
1234 -> 1.234<br />
12345 -> 12.345<br />
123456 -> 123.456
problem arises when number of digits are above 6, the code then returns
1234567 -> 1234.567
whereas I would want it to return
1234567 -> 1.234.567 and 12.345.678, 123.456.789 etc.
I realize the '$' character´s got go , since it means end of string, but if I remove it I get really strange results.
Could someone help me alter the expression to achive this?
modified on Monday, April 14, 2008 5:23 AM
|
|
|
|
|
An easier way to do this would be to just do it using string mashing. Or using string.Format to do decimal formatting 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 )
|
|
|
|
|
Solved it with System.Globalization.NumberFormatInfo, thanks!
|
|
|
|
|
Hi,
I want to load bigger size file into GUI (typically Text box),but it takes lot of time in the intial loading to avoid this like to load part of data and rest during scroll bar moving. For this i'm prefering to go for Lazy Loading.
Does anyone has solution example for lazy loading to meet his requirement? Is so give me link to walk through
Thanks
|
|
|
|
|
Sounds like you read a technical term while on the toilet and now you're hoping it will magically solve your problem. Lazy initialisation is not going to speed anything up, it just defers when something is loaded. IF a textbox takes a long time to load, one has to wonder why you're putting such a huge file in a textbox to start with.
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 )
|
|
|
|
|
Hallo,
I am working on application that provide multilanguage support. I am working with resource files. I have completed most of the part text, buttons, labels and messagebox text too. Now I want messagebox buttons YesNo to provide multilanguage support. In buttons, i have used buttons.text, but this is not working with messageBox buttons. I will be thankful if anyone could help in this regard.
Thanks in advance .
|
|
|
|
|
cooltoad123 wrote: Now I want messagebox buttons YesNo to provide multilanguage support
AFAIK, this won't change. You need to write your own message box with required buttons.
|
|
|
|
|
Navaneeth is right, the language used comes from the locale settings for the PC.
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 )
|
|
|
|
|
|
Hi,
I have to export data from a given select in a database from one server to a table from another server.If the table where i have to insert data doesn't exist, i have to create it.Since i can't use select into which also creates the table(servers are not linked so select into won't work), i have to generate script manually and i'm using the column types from the DataTable filled using a SQlAdapter to do this.My problem is how do i map System.Type in the CREATE script.I tried using DBType, but that also returns strings like Int32, which i can't use.If let's say, i change Int32 to int will work, but doing this for every Type would mean a lot of work.
Any ideas on how to do the mapping, or is there a different approach to do this?
I could use select..into..where 1=0 on the source database to create an empty temporary table, use SMO to obtain the script and delete the temporary table, but i think it has risks so i'm trying to avoid it.
Thank you
modified on Monday, April 14, 2008 7:08 AM
|
|
|
|
|
hi..
How to read and close an image from a file.I used
Image img=Image.FromFile(val) code to read image from file....But once i read that one ...I wont be able to delete it or overwrite it bcz my my current project process is using that one...Also I used bmp.Save() method to write image into file.Is there anyway to overwrite a file using bmp.Save() method ?.It will be very helpful if explains with code..
modified on Monday, April 14, 2008 3:58 AM
|
|
|
|
|
Please don't make your post bold. It's jut annoying.
You need to copy the image, close the original, and save from the copy. This is a bug in .NET.
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 )
|
|
|
|
|
Denver Thomas wrote: Image img=Image.FromFile(val)
I think Image.FromFile() won't release the file handle immediately. You may try to read the files from a stream and dispose stream after image loaded. It would be something like
Image img = null;
using (FileStream fs = new FileStream("imagePath", FileMode.Open))
{
img = Image.FromStream(fs);
}
|
|
|
|
|
hi friends....
thanks for your reply.I tried both the methods..but failed.
When i tried reading from stream...it is showing out of memmory exception.
I tried another method like take a clone of the original bitmap and dispose that one...but still that process is not releasing that image. Is there any other way to do that ?
|
|
|
|
|
Denver Thomas wrote: it is showing out of memmory exception.
What is your image size ? Is it too big ?
|
|
|
|
|
yes yes....it is 600*624 in size...any other way to do that ?
|
|
|
|