0
Answer

Less repetitive way to use datatables

Ask a question
BP

BP

14y
2.3k
1


I am completely new to vb.net and ado.net. I have been taught the basics of simple ado.net using connections, data adapters, datatables, etc. But I am currently making a program with multiple forms that need to access a database table in sql server. I think I can make each form its own connection string, data adapter, command builder, and datatable, but it doesn't seem like a good way to write code because it is so repetitive to repeat the exact same code for the module of each form that needs the database. So, is this the best way to do it, or is there a simpler, less redundant way to do it?

I found an article that may address my question, but I don't know C#, so it is hard to follow. If anyone knows it and vb.net and can explain whether or not it can be done in vb.net, that would be helpful. here is the link to the article http://www.15seconds.com/issue/031120.htm