Need Expert Help and Advice. Thank You.

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 Retrive 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
 
S

shapper

Search for ADO.NET

Peter

Yes, I use ADO.NET for creating code which work either with SQL/Oracle/
Access database, etc.
However I have no idea how to start this.

For example, I don't know:
1. Which data type should I use in the SQL 2005 database
2. How should I define the object in my C# / VB.NET and send it to the
database.

Thanks,
Miguel
 
S

shapper

Yes, I use ADO.NET for creating code which work either with SQL/Oracle/
Access database, etc.
However I have no idea how to start this.

For example, I don't know:
1. Which data type should I use in the SQL 2005 database
2. How should I define the object in my C# / VB.NET and send it to the
database.

Thanks,
Miguel

I have been also using the Enterprise Library Data Access Application
block.
I think I can do this using this ...

Thanks,
Miguel
 
M

Mark Rae

I have been also using the Enterprise Library Data Access Application
block.
I think I can do this using this ...

I've been following this thread with interest, but am really struggling to
work out what you're trying to achieve here... Maybe a bit of an explanation
as to what you're actually trying to do would be helpful...

Things tend to work best when they are used for the purpose for which they
were designed, so storing *data* in a database is good idea... :) However,
what are you actually trying to store in your database here...? What is the
purpose of doing so...? What do you intend to do with it later...? What
value is this adding to anything...? What is the overall goal...?
 
S

shapper

I've been following this thread with interest, but am really struggling to
work out what you're trying to achieve here... Maybe a bit of an explanation
as to what you're actually trying to do would be helpful...

Things tend to work best when they are used for the purpose for which they
were designed, so storing *data* in a database is good idea... :) However,
what are you actually trying to store in your database here...? What is the
purpose of doing so...? What do you intend to do with it later...? What
value is this adding to anything...? What is the overall goal...?

Mark,

Consider a web site with various pages.
Consider for example the homepage where I have an introduction text.
If the web site is multilanguage I would need to have that text in
more than one language.

So far so good. I created a control which inserts the text in various
languages in a SQL 2005 database.
for changing that text I have a form which my clients uses to edit
that text.

So all these small isolated content in my projects are saved on a SQL
2005 table.
Of course I have table for Documents or the Membership tables for
users, etc.
I use only this method for isolated content in web site pages.
Now I am trying to extend this to other data types, not just string.
For example, an integer, a control definition, a class, etc.
Of course only some of these elements will be available for the user
to edit.

Basically, I am trying to create a control which inserts various types
of resources into an SQL 2005 database.
They can be used only on my programming for saving singular
definitions or even expose the values to the user on CMS.

And of course I will use multilanguage for all of them. So I have two
tables:
One for common information on each record. For example data type, etc.
The other for the localized content, i.e., the object (string, class,
etc)

Anyway, any feedback would be great.

Thanks,
Miguel
 
S

shapper


Sure, of course. I use them.
But as I said I need to allow the client to access the data through
CMS and I prefer to use a database.

Resource files are ok for saving control properties and so on but not
to save content.

This that I am trying to do would be a mixture of saving various
resources (including objects) and content to be edited on CMS.

Anyway, I think this is possible ... ADO.NET, Enterprise Library,
etc...

For example, in ASP.NET 2.0 the profile classes are saved in the
database.

This would be something similar but saving not only classes but
objects ...

Or maybe I could create a container class which would have various
properties each one of a different type: string, integer, control, a
class, etc.

Then I would use the property or properties that I want and save that
class.

Anyway, these are just ideas ...

.... I have no idea how to start.

Any suggestions or help are welcome.

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top