|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need Expert Help and Advice. Thank You.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 Show quote "shapper" <mdmo***@gmail.com> wrote in message news:1172583362.590609.82040@k78g2000cwa.googlegroups.com... > 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 >
Show quote
On Feb 27, 3:57 pm, "Evan Camilleri" <e***@yahoo.co.uk.nospam> wrote: No no,> 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 > > "shapper" <mdmo***@gmail.com> wrote in message > > news:1172583362.590609.82040@k78g2000cwa.googlegroups.com... > > > 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 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
Show quote
On 27 Feb 2007 11:27:17 -0800, "shapper" <mdmo***@gmail.com> wrote: sql_Variant data type....>On Feb 27, 3:57 pm, "Evan Camilleri" <e***@yahoo.co.uk.nospam> wrote: >> 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 >> >> "shapper" <mdmo***@gmail.com> wrote in message >> >> news:1172583362.590609.82040@k78g2000cwa.googlegroups.com... >> >> > 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 > >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 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 Show quote "shapper" <mdmo***@gmail.com> schreef in bericht news:1172604437.322428.236290@m58g2000cwm.googlegroups.com... > On Feb 27, 3:57 pm, "Evan Camilleri" <e***@yahoo.co.uk.nospam> wrote: >> 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 >> >> "shapper" <mdmo***@gmail.com> wrote in message >> >> news:1172583362.590609.82040@k78g2000cwa.googlegroups.com... >> >> > 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 > > 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 > |
|||||||||||||||||||||||