|
then all is fine, as long as you call base.OnPaint() as the other reply mentioned.
some people by mistake create a new instance to invoke a method or add a delegate,
which obviously does not produce the result they are after.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
How to setup WebBrower Control's encoding, with code?
|
|
|
|
|
jason_mf wrote: How to setup WebBrower Control's encoding, with code?
AFAIK, you will need to specify the encoding in the HTML that you would load in the WebBrowser.
|
|
|
|
|
I have an application where configurations are stored in a XML file. I have a ConfigurationManager class which provides properties to all these XML data. I am looking for an efficient method to read data from the XML. I have tried the following
1 - Tried using XMLDocument class
Time taken : 20Milli seconds
2 - Tried using XML serializer
Time taken : 400Milli seconds
Obviously I could go with XMLDocument class approach. But I just want to make sure I am choosing the right method. BTW, is there any way to cache the configuration manager instance, then I can avoid reading it all the time.
|
|
|
|
|
Hi,
I think ConfigurationManager class has been done many optimizations. According to my knowledge it is the best method.
Yes, you can cache ConfigurationManager Instance by using Singleton Design Pattern.
Regards!
jayasshc
|
|
|
|
|
CCCJ wrote: I think ConfigurationManager class has been done many optimizations
I was speaking about my custom ConfigurationManager class.
CCCJ wrote: you can cache ConfigurationManager Instance by using Singleton Design Pattern.
Fine. Any good links for this ?
|
|
|
|
|
Check this out
http://msdn2.microsoft.com/en-us/library/system.configuration.configurationmanager.aspx
jayasshc
|
|
|
|
|
Hi,
I have created a window application. I have to provide security to it. I have to provide a login form with username and password. The username and password are present in the database. When i click the login button it should compare the username and password entered in the form with that in database and give access to the Window application that i first created. How to do it.
Please help
Nitin Raj Bidkikar
|
|
|
|
|
Hi,
add a form to your project. Add two textboxes to the form. Add a button to the form. Hook up the button's onclick event handler to retrieve data from the database and compare this with the data in the textboxes.
Best,
Morten
|
|
|
|
|
Hi,
I am creating Excel sheets using Excel Automation library. I want to change 'Negative Number' format for 'Currency' category. Please help, if you know how to do it!
Thanks!
jayasshc
|
|
|
|
|
Hi,
You might required to reach the required cells/range of cells to format the cells.
Excel.Application excelApp = new Excel.ApplicationClass();<br />
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(File_Path,<br />
0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "",<br />
true, false, 0, true, false, false);<br />
Excel.Sheets excelSheets = excelWorkbook.Worksheets;<br />
Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item(fileName);<br />
Excel.Range excelCells;<br />
<br />
excelCells = (Excel.Range)excelWorksheet.get_Range("A1", "G1");<br />
excelCells.Select();<br />
The above example code will select a range of cells from A1 (column name) to G1 (column name). Now you have range of required cells to apply any specific format.
Here let me explian some formating tips interms of Font style and name.
excelCells.WrapText=true;<br />
excelCells.HorizontalAlignment=Excel.Constants.xlCenter;<br />
excelCells.Borders.LineStyle=Excel.Constants.xlSolid;<br />
excelCells.Font.Bold = true;<br />
excelCells.Font.Size = 9;<br />
excelCells.Font.Name = "Verdana";
If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com
|
|
|
|
|
Hi,
I want to give Currency Format for Negative Numbers, do you have any code snippet for that?
Thanks a LOT!
jayasshc
|
|
|
|
|
Hi,
In line with the last post, you can use this line of code to retrieve the value from a specified cell and use string format.
excelCells = (Excel.Range)excelWorksheet.get_Range("A1",Type.Missing); <br />
excelCells.Value2 = "File Name";
If the post/article served your purpose then, please assist me in keeping it up by donating a small amount of money to my Paypal account. Email: sreejithssnair@hotmail.com
|
|
|
|
|
I want to connect to a database and retrieve and insert data which is in another server.which means the database is not in our server.
it may be in another server globally remote.
this is about an asp web application.
please reply me as soon as possible
dayya
gayan
|
|
|
|
|
One solution of this problem is create a web service and communicating with SOAP.
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
I'm a beginner to .net.
can you please explain how to do that
gayan
|
|
|
|
|
Are yo trying to connect to it from the DB itself? As in from one DB to another that's on a different server? If so then you more appropriately it should be posted in the SQL forums.
If you're doing this from C# then, unless its on a different vlan, then you need a web service (definition: Clickety[^]). If its on the same lan (read network) then you need to be more specific in specifying your connection string by specifying the server name or the IP address (more on that here: Clickety 2[^])
Web Services are not .Net specific, so don't blame your lack of understanding on .Net. There are many articles here that explain Web Services and give you examples. Here, I'll do your lazy work for you: (Clickety 3[^])
You also might want to try the ultimate answer tool. I mean this Clickety 4[^] rather than anything else.
"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." - Rick Cook
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
Please search for creating web services in .net
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
There are two options of doing that.
1. You can access it via our normal ADO.Net by creating the connection to that server and doing what you want on that server.
2. If your database server is MS SQL Server then you can create what is called a linked server... in this case you have to connect to you own server and fire select and insert queries on the remote server.
Hope this helps..
Maharishi
Nothing is Impossible. Even impossible spells "i m possible"
|
|
|
|
|
Hi, i have a requirement of online exam. Just all the question and answers are in Database and retriving them and showing on the webpage.
Suppose if the question contains a code snippent, how to store it in database and how to show the same format in webpage?
Ex: How to store the below code in database as it is?
public static void main()
{
MessageBox.show("code snippent");
}
|
|
|
|
|
you have to append new line (\n) character in your string
|
|
|
|
|
yes, it is correct to store data using "/n".
But, suppose user posting a codesnippent in discussion forum like(Ex: posting message with code snippent in codeproject). User types message in textarea and submit the post. When i am reading the whole data will get in one string. How can i separate it for new line?
Ex: string strmsg = txtArea.text.Tostring();
now the strmsg contains whole text. How can split the strmsg for newline. How i know where the new line occurs
|
|
|
|
|
hi,
My aim is to print the form n have code for that .....
...my problems
1. How to make the form of A4 size
2. Is there any proc to print the form ...zooming a form can solve this ........prob ?
if any is having any clue abt this then plz let me know..
regards
sindhu tiwari
always innovative
|
|
|
|
|
|
sir ... i would like to tell the whole scenario behind this problem
i have developed a software in which the user will drag and drop labels and picture boxes then bind to a database.. now whenever the print button is clicked the form gets printed(""" i can save the form as a picture n can print it directly""") my problem is that i cant create a form of A4 size so how to make the form size to a4 so that the printing can be done ...i strongly feel that u will help me ...n i hope that the above given info gives u a glimpse of what i wanna do
regards
sindhu tiwari
its me sid
|
|
|
|