I manually created a DataTable in a Typed DataSet using the DataSet designer
in VS 2008 Pro. One of the Column names is "IN". When referencing this
table in VB.Net 2008, the IntelliSense did not show the column "IN" but it
did show a column "_IN'. If I tried to reference this column in code using
"tablenameRow.IN" I got the build error: "'IN' is not a member of
'app.DataSet.tableRow". If I reference it with "tablenameRow._IN" then I
don't get the build error. I have several other 2-letter-capitalized column
names in this table such as: "'LT', 'PI' and 'MA'". These other column names
show up in intellisense and can be referenced without the "_" prefix.

Can someone tell me what's going on?

Thanks
--
Robert Scarborough
Integrated Visual Systems

Re: Underscore ("_") prefix added to my Column Name by Miha

Miha
Thu Apr 24 02:49:08 CDT 2008

IN is a sql keyword....

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"r0bb1e" <r0bb1e@discussions.microsoft.com> wrote in message
news:24472FF6-51B5-4B72-A447-3B8ADFFBA103@microsoft.com...
>I manually created a DataTable in a Typed DataSet using the DataSet
>designer
> in VS 2008 Pro. One of the Column names is "IN". When referencing this
> table in VB.Net 2008, the IntelliSense did not show the column "IN" but it
> did show a column "_IN'. If I tried to reference this column in code
> using
> "tablenameRow.IN" I got the build error: "'IN' is not a member of
> 'app.DataSet.tableRow". If I reference it with "tablenameRow._IN" then I
> don't get the build error. I have several other 2-letter-capitalized
> column
> names in this table such as: "'LT', 'PI' and 'MA'". These other column
> names
> show up in intellisense and can be referenced without the "_" prefix.
>
> Can someone tell me what's going on?
>
> Thanks
> --
> Robert Scarborough
> Integrated Visual Systems


Re: Underscore ("_") prefix added to my Column Name by r0bb1e

r0bb1e
Thu Apr 24 12:11:02 CDT 2008

T thought of that, so for a test I created a Column named "FROM'. This did
not cause a column named "_FROM" to be created. And referencing
"tablenameRow.From" caused no build errors. Furthermore, Intellisense showed
the column "From" in the list of properties/columns for the DataTable Row.
(Although it didn't show up as all capitals in Intellisense and when I put
"tablenameRow.FROM" in my code, Visual Studio changed it to
"tablenameRow.From".

So why does the system treat "FROM" different from "IN"? They're both SQL
reserverd words.

--
Robert Scarborough
Integrated Visual Systems


"Miha Markic" wrote:

> IN is a sql keyword....
>
> --
> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
> RightHand .NET consulting & development www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>
> "r0bb1e" <r0bb1e@discussions.microsoft.com> wrote in message
> news:24472FF6-51B5-4B72-A447-3B8ADFFBA103@microsoft.com...
> >I manually created a DataTable in a Typed DataSet using the DataSet
> >designer
> > in VS 2008 Pro. One of the Column names is "IN". When referencing this
> > table in VB.Net 2008, the IntelliSense did not show the column "IN" but it
> > did show a column "_IN'. If I tried to reference this column in code
> > using
> > "tablenameRow.IN" I got the build error: "'IN' is not a member of
> > 'app.DataSet.tableRow". If I reference it with "tablenameRow._IN" then I
> > don't get the build error. I have several other 2-letter-capitalized
> > column
> > names in this table such as: "'LT', 'PI' and 'MA'". These other column
> > names
> > show up in intellisense and can be referenced without the "_" prefix.
> >
> > Can someone tell me what's going on?
> >
> > Thanks
> > --
> > Robert Scarborough
> > Integrated Visual Systems
>
>

Re: Underscore ("_") prefix added to my Column Name by amdrit

amdrit
Fri Apr 25 11:53:07 CDT 2008

IN is a reserved word in VB.Net. If you look at the underlying column name
constant, you'll see that it is still named "IN".

Note: This doesn't happen in C#, only in VB. Also note that wrapping IN
inside of [] allows what you want in normal classes, however the generation
tool doesn't know to do this.

VB

Public Property [IN]() As String
Public Property_IN() As String

C#

public string IN {get;set;}



"r0bb1e" <r0bb1e@discussions.microsoft.com> wrote in message
news:B61EFEC9-40AE-4D05-BC2B-A95FEE48C923@microsoft.com...
>T thought of that, so for a test I created a Column named "FROM'. This did
> not cause a column named "_FROM" to be created. And referencing
> "tablenameRow.From" caused no build errors. Furthermore, Intellisense
> showed
> the column "From" in the list of properties/columns for the DataTable Row.
> (Although it didn't show up as all capitals in Intellisense and when I put
> "tablenameRow.FROM" in my code, Visual Studio changed it to
> "tablenameRow.From".
>
> So why does the system treat "FROM" different from "IN"? They're both SQL
> reserverd words.
>
> --
> Robert Scarborough
> Integrated Visual Systems
>
>
> "Miha Markic" wrote:
>
>> IN is a sql keyword....
>>
>> --
>> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
>> RightHand .NET consulting & development www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>>
>> "r0bb1e" <r0bb1e@discussions.microsoft.com> wrote in message
>> news:24472FF6-51B5-4B72-A447-3B8ADFFBA103@microsoft.com...
>> >I manually created a DataTable in a Typed DataSet using the DataSet
>> >designer
>> > in VS 2008 Pro. One of the Column names is "IN". When referencing
>> > this
>> > table in VB.Net 2008, the IntelliSense did not show the column "IN" but
>> > it
>> > did show a column "_IN'. If I tried to reference this column in code
>> > using
>> > "tablenameRow.IN" I got the build error: "'IN' is not a member of
>> > 'app.DataSet.tableRow". If I reference it with "tablenameRow._IN" then
>> > I
>> > don't get the build error. I have several other 2-letter-capitalized
>> > column
>> > names in this table such as: "'LT', 'PI' and 'MA'". These other column
>> > names
>> > show up in intellisense and can be referenced without the "_" prefix.
>> >
>> > Can someone tell me what's going on?
>> >
>> > Thanks
>> > --
>> > Robert Scarborough
>> > Integrated Visual Systems
>>
>>



Re: Underscore ("_") prefix added to my Column Name by Miha

Miha
Sat Apr 26 03:42:02 CDT 2008

IN is also a keyword for DataColumn.Expression language.

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"r0bb1e" <r0bb1e@discussions.microsoft.com> wrote in message
news:B61EFEC9-40AE-4D05-BC2B-A95FEE48C923@microsoft.com...
>T thought of that, so for a test I created a Column named "FROM'. This did
> not cause a column named "_FROM" to be created. And referencing
> "tablenameRow.From" caused no build errors. Furthermore, Intellisense
> showed
> the column "From" in the list of properties/columns for the DataTable Row.
> (Although it didn't show up as all capitals in Intellisense and when I put
> "tablenameRow.FROM" in my code, Visual Studio changed it to
> "tablenameRow.From".
>
> So why does the system treat "FROM" different from "IN"? They're both SQL
> reserverd words.