Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2007-02-27 : 08:32:14
|
Hello,I am using Enterprise Library Data Access and SQL 2005 application block and I need to know if it is possible to do the following:Consider I have a String:Dim MyString As String = "Hello"or an Integer:Dim MyInteger As Integer = 100or a class which its properties:Dim MyClass As New MyCustomClassMyClass.Property1 = "Hello"MyClass.Property2 = Unit.Pixel(100)MyClass.Property3 = 100Or even a control:Dim MyLabel As LabelMyLabel.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 Retrive from database given its IDIs this possible?How should I do this?What type of SQL 2005 table field should be used to store the information?Thanks,Miguel |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-02-27 : 09:46:58
|
you can do that with a dataset and it's update methodwhat do you want exactly?save settings?Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2007-02-27 : 09:58:03
|
Basically,I need to know:1. What should the data type of the SQL 2005 table column which will hold the objects (It can be a string, an integer, a class, a control, a boolean, etc)2. In .NET code how can I "prepare" my object before send it to the database. What should be the .NET type?I suppose I need to convert my object (String, Class, Control, ...) to some kind of SQL object type?By the way I am working with Enterprise Library Data Access Application Block.This is not as straight forward as using a dataset.Anyone?Thanks,Miguel |
 |
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
|
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2007-02-28 : 10:46:41
|
quote: Originally posted by snSQL or you can serialize your object and store the serialized data in the database and deserialize when you read it. In this case you can store that data in a varbinary column or an xml column depending on which formatter you use to preform the serilaization. Seehttp://msdn2.microsoft.com/en-us/library/system.runtime.serialization.aspx
I think I am going this way using binary serialization.Thank You for your help,Miguel |
 |
|
|
|
|
|
|