store custom types in DB

N

neverstill

Hi-

I'm researching storing complex data types into a databasem tehn retrieving
them later. IE:
public class CMyClass
{
string m_name;
}

Obviously, for this example it would be easier to just store the string, but
that is not the point. The actual types are more complex. What I wanted to
ask you all is, how can I do this with ADO.Net? Do I need to Serialize the
class to a byte[] then save that to the DB or is there some other technique
that would be easier, cleaner? Anyone ever do this?

OK, thanks. Looking forward to any suggestions!!

-Steve
 
M

Miha Markic

Hi,


neverstill said:
Hi-

I'm researching storing complex data types into a databasem tehn retrieving
them later. IE:
public class CMyClass
{
string m_name;
}

Obviously, for this example it would be easier to just store the string, but
that is not the point. The actual types are more complex. What I wanted to
ask you all is, how can I do this with ADO.Net? Do I need to Serialize the
class to a byte[] then save that to the DB or is there some other technique
that would be easier, cleaner? Anyone ever do this?

Serialization would be just fine.
 
S

Steve

good to know, thanks! I'll get started :)
Miha Markic said:
Hi,


neverstill said:
Hi-

I'm researching storing complex data types into a databasem tehn retrieving
them later. IE:
public class CMyClass
{
string m_name;
}

Obviously, for this example it would be easier to just store the string, but
that is not the point. The actual types are more complex. What I
wanted
to
ask you all is, how can I do this with ADO.Net? Do I need to Serialize the
class to a byte[] then save that to the DB or is there some other technique
that would be easier, cleaner? Anyone ever do this?

Serialization would be just fine.
 

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

Top