Python DBM style library for .net

  • Thread starter Thread starter Mike Margerum
  • Start date Start date
M

Mike Margerum

Is there a DBM equivalent in .net?

I want to store serialized C# objects in a file store using a GUID key
in a random access fashion. Pretty much a dictionary<> that is disk based.

Thanks
 
Mike said:
Is there a DBM equivalent in .net?

I want to store serialized C# objects in a file store using a GUID key
in a random access fashion. Pretty much a dictionary<> that is disk based.

SQLServer, one table with two fields: one of type UNIQUEIDENTIFIER
and one of type IMAGE, then store objects serialized as
byte arrays.

ARne
 
Thanks Arne but I was hoping for something I could embed right in my app
with C# source code or a simple assembly. I don't want to install the
MSDE or SQL server as it would be total overkill.
 
Mike said:
Thanks Arne but I was hoping for something I could embed right in my app
with C# source code or a simple assembly. I don't want to install the
MSDE or SQL server as it would be total overkill.

Embedded FireBird maybe ?

Arne
 
I dont really even need a relational database. I dont want to do
selects/updates/inserts. Just somthing very similar to the DBM library
for python.

Here is an example in python of using dbm. it writes dictionary
key/value pairs to a file and then reads them in.

db = dbm.open("dbm", "c")
db["first"] = "bruce"
db["second"] = "bruce"
db["third"] = "bruce"
db["fourth"] = "bruce"
db["fifth"] = "michael"
db["fifth"] = "bruce" # overwrite
db.close()

db = dbm.open("dbm", "r")
for key in db.keys():
print repr(key), repr(db[key])
 
I want to store serialized C# objects in a file store using a GUID key in
a random access fashion. Pretty much a dictionary<> that is disk based.

You could try and search for a little product called "Perst". It's free-ish
and it's really good.
 
You could try and search for a little product called "Perst". It's
free-ish and it's really good.


interesting. Why do you have to derive your objects from IPersist
though? Is this becauseo f it's java roots?

Isn't the [Serialiable] attribute all you'd need?
 

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

Back
Top