|
-
Mar 22nd, 2003, 10:11 AM
#1
Thread Starter
Sleep mode
unassigned local variable[Resolved]
Why I keep getting this error whenever I declare new instance of data.ole classes ??
" Class1.cs(184): Use of unassigned local variable 'adoReader' "
Last edited by Pirate; Mar 22nd, 2003 at 12:43 PM.
-
Mar 22nd, 2003, 10:15 AM
#2
Thread Starter
Sleep mode
Re: unassigned local variable
here's what I did :
Code:
System.Data.OleDb.OleDbCommandBuilder builder;
It looks right . Doesn't it ?
-
Mar 22nd, 2003, 10:42 AM
#3
PowerPoster
C# enforces definite assignment, meaning, all variables must be assigned a value before accessing one of the objects members. For example:
Code:
int i; // should be int i = 0;
// this will throw an error
Console.WriteLine(i.ToString());
-
Mar 22nd, 2003, 11:10 AM
#4
Thread Starter
Sleep mode
That's right . But if I don't want to intialize a variable . still possible ?
Thanks
-
Mar 22nd, 2003, 12:05 PM
#5
Frenzied Member
Dont gain the world and lose your soul
-
Mar 22nd, 2003, 12:43 PM
#6
Thread Starter
Sleep mode
Originally posted by DevGrp
assign it null
Good idea
Thanks guys !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|