Need Expert Help and Advice. Thank You.

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

Consider I have a String:

Dim MyString As String = "Hello"

or an Integer:

Dim MyInteger As Integer = 100

or a class which its properties:

Dim MyClass As New MyCustomClass
MyClass.Property1 = "Hello"
MyClass.Property2 = Unit.Pixel(100)
MyClass.Property3 = 100

Or even a control:

Dim MyLabel As Label
MyLabel.Id = "MyLabel"
MyLabel.CssClass = "MyLabelCssClass"

Is there a way to save a String, an Integer, a Boolean, a Class, a
Control in an SQL database?

Something like:

Define something (Integer, String, Class, Control, etc)

Save in SQL 2005 Database

Later in code Retrieve from database given its ID

Is this possible?

How should I do this?

What type of SQL 2005 table field should be used to store the
information?

Thanks,

Miguel
 
you mean that when you enter the id you get the whole lot: String, an
Integer, a Boolean, a Class, a Control
i think you need to save the data in XML format in the database. SQL2005
has some xml datatype while in sql2000 you can use varchar and insert xml
data which contains what you need.

Evan
 
you mean that when you enter the id you get the whole lot: String, an
Integer, a Boolean, a Class, a Control
i think you need to save the data in XML format in the database. SQL2005
has some xml datatype while in sql2000 you can use varchar and insert xml
data which contains what you need.

Evan

No no,

I just want to save something in a database but it can be a string, an
integer, a boolean, a control or a class ...
But it will be only one object.

Is this possible?

If not, how can I save an object or a class in an SQL 2005 database?
What data type should I use and is there anything different from
saving, let's say, a string into the database?

Thanks,
Miguel
 
No no,

I just want to save something in a database but it can be a string, an
integer, a boolean, a control or a class ...
But it will be only one object.

Is this possible?

If not, how can I save an object or a class in an SQL 2005 database?
What data type should I use and is there anything different from
saving, let's say, a string into the database?

Thanks,
Miguel
sql_Variant data type....

Good luck with your project,

Otis Mukinfus

http://www.otismukinfus.com
http://www.arltex.com
http://www.tomchilders.com
http://www.n5ge.com
 
shapper,

A real class you can never same in your database, it is just a type.

An object you can save as a blob (image) field.

Cor
 
Back
Top