1

Can i use a dynamic C# object to access database values. For example if i have a table name Settings, with different values could i simply call from code Settings.SomeSetting, rather then programming them all.

1
  • What is it that you call a dynamic object? Worst case you can simply save the setting to a text file and load them for example... Commented May 10, 2012 at 1:12

4 Answers 4

1

You could also use a C# ORM in order to do something like what you are trying to do.

Dapper.Net - A simple C# ORM.
NHibernate - A mature ORM which has been around while.

I don't have experience with either but both sound like something you are trying to achieve.

Sign up to request clarification or add additional context in comments.

Comments

0

Here's a blog post showing one technique using a dynamic wrapper for ADO.NET data access. This should work against a query run against an Access database (as well as any other ADO.NET data source).

Comments

0

Yes, you can.

Probably you will get insane later, but you can. Also, if you want to access the data in a reflective way and without compilation check, you could just use DataSets. They suck, but... You are about to reinvent the weel.

Comments

0

Have a look at Simple.Data. It sounds like what you're looking for.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.