Click here to Skip to main content
15,890,670 members
Home / Discussions / C#
   

C#

 
AnswerRe: string conversion Pin
Maqsood Ahmed12-Oct-05 20:13
Maqsood Ahmed12-Oct-05 20:13 
QuestionRe: string conversion Pin
Brendan Vogt12-Oct-05 20:33
Brendan Vogt12-Oct-05 20:33 
GeneralRe: string conversion Pin
Brendan Vogt17-Oct-05 22:12
Brendan Vogt17-Oct-05 22:12 
QuestionTimeline controls in C# Pin
jpvanoosten9-Oct-05 21:53
jpvanoosten9-Oct-05 21:53 
Questionnull string Pin
Brendan Vogt9-Oct-05 21:52
Brendan Vogt9-Oct-05 21:52 
AnswerRe: null string Pin
Maxim Ignatyev9-Oct-05 22:35
Maxim Ignatyev9-Oct-05 22:35 
AnswerRe: null string Pin
S. Senthil Kumar10-Oct-05 2:08
S. Senthil Kumar10-Oct-05 2:08 
AnswerRe: null string Pin
XRaheemX10-Oct-05 4:58
XRaheemX10-Oct-05 4:58 
The compiler will error out if you don't initialize the variable before setting it. In this case it doesn't matter whether or not strName is null, you just have to set it first. Try this code bit:


<code>
private string strName = null;

if(txtName.Text.Trim() != "")
strName = txtName.Text.Trim();
</code>



A more safe and better way to do this would be:

<code>
private string strName = null;

if(txtName != null && txtName.Text.Trim().Length > 0)
strName = txtName.Text.Trim();
</code>

QuestionDebugging class library (DLL) Pin
raed9-Oct-05 21:52
raed9-Oct-05 21:52 
AnswerRe: Debugging class library (DLL) Pin
S. Senthil Kumar10-Oct-05 2:15
S. Senthil Kumar10-Oct-05 2:15 
GeneralRe: Debugging class library (DLL) Pin
raed10-Oct-05 2:44
raed10-Oct-05 2:44 
QuestionPage.IsPostBack Pin
Brendan Vogt9-Oct-05 21:47
Brendan Vogt9-Oct-05 21:47 
AnswerRe: Page.IsPostBack Pin
David Stone10-Oct-05 5:43
sitebuilderDavid Stone10-Oct-05 5:43 
QuestionHelp required on remote objects in C# Pin
kschakravarthy9-Oct-05 20:41
kschakravarthy9-Oct-05 20:41 
AnswerRe: Help required on remote objects in C# Pin
S. Senthil Kumar10-Oct-05 2:19
S. Senthil Kumar10-Oct-05 2:19 
GeneralRe: Help required on remote objects in C# Pin
kschakravarthy10-Oct-05 20:56
kschakravarthy10-Oct-05 20:56 
QuestionProcess Large File Results Server Application Unavailable Pin
Member 14325389-Oct-05 20:00
Member 14325389-Oct-05 20:00 
AnswerRe: Process Large File Results Server Application Unavailable Pin
Guffa10-Oct-05 0:55
Guffa10-Oct-05 0:55 
QuestionRTF (RichText) draw using GDI+ like VISIO 2003 style. Richtext able to rotate and translate. Pin
thewizardcode9-Oct-05 18:31
thewizardcode9-Oct-05 18:31 
QuestionRS 232 Programming Pin
mipooo9-Oct-05 18:17
mipooo9-Oct-05 18:17 
QuestionSaving Excel workbook in SQL server using c# Pin
Member 22989639-Oct-05 18:09
Member 22989639-Oct-05 18:09 
QuestionHow do i make controls that are transparent, but still show the form behind them? Pin
Red_Wizard_Shot_The_Food9-Oct-05 15:46
Red_Wizard_Shot_The_Food9-Oct-05 15:46 
AnswerRe: How do i make controls that are transparent, but still show the form behind them? Pin
Red_Wizard_Shot_The_Food9-Oct-05 18:07
Red_Wizard_Shot_The_Food9-Oct-05 18:07 
GeneralRe: How do i make controls that are transparent, but still show the form behind them? Pin
XRaheemX10-Oct-05 10:08
XRaheemX10-Oct-05 10:08 
GeneralRe: How do i make controls that are transparent, but still show the form behind them? Pin
Red_Wizard_Shot_The_Food10-Oct-05 11:17
Red_Wizard_Shot_The_Food10-Oct-05 11:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.