473,414 Members | 1,636 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Shortcut for Converting Table to Class

Just out of curiosity, I don't suppose ASP.NET provides any tools to make it
easier to read a table from a database and convert it to a class object,
does it?

As it is, I need to create a class for each table type, manually type in all
the members, and then write code to read the database, and finally to copy
the database table to the class, checking nullable fields with IsDBNull().

Just wanted to make sure there isn't a better way.

Also, it would also be nice if there was a shortcut for exposing private
members. As it is, I declare all my private members, and then type in all
the public get/set statements of the public property. Like everything else
in .NET, seems like a lot of typing.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Jan 10 '08 #1
8 1426
Liz

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:eh****************@TK2MSFTNGP05.phx.gbl...
Just out of curiosity, I don't suppose ASP.NET provides any tools to make
it easier to read a table from a database and convert it to a class
object, does it?

As it is, I need to create a class for each table type, manually type in
all the members, and then write code to read the database, and finally to
copy the database table to the class, checking nullable fields with
IsDBNull().

Just wanted to make sure there isn't a better way.

Also, it would also be nice if there was a shortcut for exposing private
members. As it is, I declare all my private members, and then type in all
the public get/set statements of the public property. Like everything else
in .NET, seems like a lot of typing.

it would be fairly easy to write a little code generator to do all of that
with SMO ... or look at the product at simego.com

Jan 11 '08 #2
SMO?

I'll check out simego.com.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Liz" <li*@tiredofspam.comwrote in message
news:Ol**************@TK2MSFTNGP06.phx.gbl...
>
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:eh****************@TK2MSFTNGP05.phx.gbl...
>Just out of curiosity, I don't suppose ASP.NET provides any tools to make
it easier to read a table from a database and convert it to a class
object, does it?

As it is, I need to create a class for each table type, manually type in
all the members, and then write code to read the database, and finally to
copy the database table to the class, checking nullable fields with
IsDBNull().

Just wanted to make sure there isn't a better way.

Also, it would also be nice if there was a shortcut for exposing private
members. As it is, I declare all my private members, and then type in all
the public get/set statements of the public property. Like everything
else in .NET, seems like a lot of typing.


it would be fairly easy to write a little code generator to do all of that
with SMO ... or look at the product at simego.com


Jan 11 '08 #3
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:eO**************@TK2MSFTNGP05.phx.gbl...
SMO?
http://msdn2.microsoft.com/en-us/library/ms162169.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jan 11 '08 #4
see typed datasets.

http://msdn2.microsoft.com/en-us/lib...zb(vs.71).aspx

-- bruce (sqlwork.com)
"Jonathan Wood" wrote:
Just out of curiosity, I don't suppose ASP.NET provides any tools to make it
easier to read a table from a database and convert it to a class object,
does it?

As it is, I need to create a class for each table type, manually type in all
the members, and then write code to read the database, and finally to copy
the database table to the class, checking nullable fields with IsDBNull().

Just wanted to make sure there isn't a better way.

Also, it would also be nice if there was a shortcut for exposing private
members. As it is, I declare all my private members, and then type in all
the public get/set statements of the public property. Like everything else
in .NET, seems like a lot of typing.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Jan 11 '08 #5
.... or you could also evaluate if LINQ would fit :
http://msdn2.microsoft.com/en-gb/library/bb397897.aspx

--
Patrice

"Jonathan Wood" <jw***@softcircuits.coma écrit dans le message de news:
eh****************@TK2MSFTNGP05.phx.gbl...
Just out of curiosity, I don't suppose ASP.NET provides any tools to make
it easier to read a table from a database and convert it to a class
object, does it?

As it is, I need to create a class for each table type, manually type in
all the members, and then write code to read the database, and finally to
copy the database table to the class, checking nullable fields with
IsDBNull().

Just wanted to make sure there isn't a better way.

Also, it would also be nice if there was a shortcut for exposing private
members. As it is, I declare all my private members, and then type in all
the public get/set statements of the public property. Like everything else
in .NET, seems like a lot of typing.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Jan 11 '08 #6
Thanks!

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:eZ**************@TK2MSFTNGP05.phx.gbl...
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:eO**************@TK2MSFTNGP05.phx.gbl...
>SMO?

http://msdn2.microsoft.com/en-us/library/ms162169.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Jan 11 '08 #7
Thanks, although I've looked into LINQ a bit already and have trouble really
seeing why it is useful. I'll check out that link though.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Patrice" <http://www.chez.com/scribe/wrote in message
news:uV*************@TK2MSFTNGP06.phx.gbl...
... or you could also evaluate if LINQ would fit :
http://msdn2.microsoft.com/en-gb/library/bb397897.aspx

--
Patrice

"Jonathan Wood" <jw***@softcircuits.coma écrit dans le message de news:
eh****************@TK2MSFTNGP05.phx.gbl...
>Just out of curiosity, I don't suppose ASP.NET provides any tools to make
it easier to read a table from a database and convert it to a class
object, does it?

As it is, I need to create a class for each table type, manually type in
all the members, and then write code to read the database, and finally to
copy the database table to the class, checking nullable fields with
IsDBNull().

Just wanted to make sure there isn't a better way.

Also, it would also be nice if there was a shortcut for exposing private
members. As it is, I declare all my private members, and then type in all
the public get/set statements of the public property. Like everything
else in .NET, seems like a lot of typing.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Jan 11 '08 #8
I'll check that out. Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"bruce barker" <br*********@discussions.microsoft.comwrote in message
news:3D**********************************@microsof t.com...
see typed datasets.

http://msdn2.microsoft.com/en-us/lib...zb(vs.71).aspx

-- bruce (sqlwork.com)
"Jonathan Wood" wrote:
>Just out of curiosity, I don't suppose ASP.NET provides any tools to make
it
easier to read a table from a database and convert it to a class object,
does it?

As it is, I need to create a class for each table type, manually type in
all
the members, and then write code to read the database, and finally to
copy
the database table to the class, checking nullable fields with
IsDBNull().

Just wanted to make sure there isn't a better way.

Also, it would also be nice if there was a shortcut for exposing private
members. As it is, I declare all my private members, and then type in all
the public get/set statements of the public property. Like everything
else
in .NET, seems like a lot of typing.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Jan 11 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Robert P. Stearns | last post by:
I have been trying to convert the following simple table into CSS. <table> <tr><th colspan=2>Header Area</th></tr> <tr><th>Navigation Area</th><th>Information Area</th></tr> <tr><th...
3
by: lostinspace | last post by:
Hello, My sites were created primarily with tables as layout. :-( I have two page designs which I used frequently and hopefully somebody can provide some insight as to whether its best to remain...
2
by: Benjamin | last post by:
I have a very strange problem. I have developed a .NET solution. To set up user clients I have also included a "Deployment Project" in the solution: Using "File System Editor | User's Program...
2
by: Asbjørn Ulsberg | last post by:
Hi. I'm trying to convert Brady Hegberg's great RTF2HTML VB 6.0 module to C#. I've managed to convert the VB code to VB.NET, which gave me the following code: Option Strict On Option...
2
by: genojoe | last post by:
I have a table (about 50 rows that populate the variables shown below in lines 1 and 2) of shortcuts that I would like to read into a Windows Form. The following code would work with one big...
7
by: moondaddy | last post by:
If I'm in a class that inherits an interface, is there a shortcut key that will write the implementation of the interface into the class? I remember seeing something like this in vb.net. ...
1
by: stinehelferw | last post by:
I need a right-click menu on a form list control with combobox controls. I used View->Toolbars->Customize to create a toolbar. I added ComboBox through commands tab. I set properties to Popup...
10
by: Michael Maes | last post by:
Hi, I want to have a Button.Click event 'raise' a shortcut. If eg Button1 is Clicked, I want to have a shortcut 'CTRL + F12' activated. What's the best way to acchieve this. TIA, Michael
0
by: Newbie Coder | last post by:
A few years ago I created a shortcut class using the correct functions/COM interfaces(IShellLinkA,/IShellLinkW/GUID's...) I use this class to create shortcuts the correct way not streamwriter but...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.