How C# should communicate with access db file ?
-
Well, I have a lot of questions regarding this topic, so i'll show you some of my doubts: I'm currently developing a C# windows forms application that communicates with a access database file to store all my data. Now that my relational database is getting bigger, i'm wondering if I should make table relations inside the access file or in C#. Sometimes I have to make changes to more than one table at a time and I don´t know how and who should do these kind of transactions (access/c#). I need to use DataSets, Datareaders, Databinding, etc to do that, right? How these communication should work, I mean, best practice for this!? Hope you can help me with this. Thanks, bisc8 PS - Some good book about this?
-
Well, I have a lot of questions regarding this topic, so i'll show you some of my doubts: I'm currently developing a C# windows forms application that communicates with a access database file to store all my data. Now that my relational database is getting bigger, i'm wondering if I should make table relations inside the access file or in C#. Sometimes I have to make changes to more than one table at a time and I don´t know how and who should do these kind of transactions (access/c#). I need to use DataSets, Datareaders, Databinding, etc to do that, right? How these communication should work, I mean, best practice for this!? Hope you can help me with this. Thanks, bisc8 PS - Some good book about this?
The database is the proper place to define the data structure. I would also suggest using SQL Express rather than Access. If your needing to scale it will provide better capabilities than Access.
biscoito wrote:
I need to use DataSets, Datareaders, Databinding, etc to do that, right?
What do DataSets or DataReaders have to do with defining the structure of a database? I think you are very confused.
I know the language. I've read a book. - _Madmatt
-
The database is the proper place to define the data structure. I would also suggest using SQL Express rather than Access. If your needing to scale it will provide better capabilities than Access.
biscoito wrote:
I need to use DataSets, Datareaders, Databinding, etc to do that, right?
What do DataSets or DataReaders have to do with defining the structure of a database? I think you are very confused.
I know the language. I've read a book. - _Madmatt
SQL Express compact edition is the best db that can go with C#. Are u developing in C#.net or ordinary c#?
-
SQL Express compact edition is the best db that can go with C#. Are u developing in C#.net or ordinary c#?
sidhu hacks wrote:
C#.net or ordinary c#?
Feel free to explain that. AFAIK there is VB and VB.NET; however I've never seen any C# outside a .NET environment. :confused:
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
-
SQL Express compact edition is the best db that can go with C#. Are u developing in C#.net or ordinary c#?
sidhu hacks wrote:
SQL Express compact edition is the best db that can go with C#.
Care to explain that? You mean SQL Server or Oracle can't be used with C#? I think you are very misinformed.
I know the language. I've read a book. - _Madmatt
-
sidhu hacks wrote:
SQL Express compact edition is the best db that can go with C#.
Care to explain that? You mean SQL Server or Oracle can't be used with C#? I think you are very misinformed.
I know the language. I've read a book. - _Madmatt
i didnt mean that this is the only db that can go with c#. I meant its best to use rather than access or any other.(bcoz i feel easy in this compact edition ;P )
-
i didnt mean that this is the only db that can go with c#. I meant its best to use rather than access or any other.(bcoz i feel easy in this compact edition ;P )
Wrong again. Perhaps you should research a little, http://www.microsoft.com/sqlserver/2008/en/us/editions.aspx[^] The best database is the one that fits the needs
I know the language. I've read a book. - _Madmatt
-
Wrong again. Perhaps you should research a little, http://www.microsoft.com/sqlserver/2008/en/us/editions.aspx[^] The best database is the one that fits the needs
I know the language. I've read a book. - _Madmatt
did u read the content within those bracket?
-
did u read the content within those bracket?
I've done more reading than you apparently. What is your point? Just because you are more comfortable with one database or edition over another does not make it the "best" choice.
I know the language. I've read a book. - _Madmatt
-
I've done more reading than you apparently. What is your point? Just because you are more comfortable with one database or edition over another does not make it the "best" choice.
I know the language. I've read a book. - _Madmatt
best choice for me yar... i didnt say for all... ok u want in access? right? i wil send u via mail...
-
best choice for me yar... i didnt say for all... ok u want in access? right? i wil send u via mail...
hi biscoito ur mail id pls. i wil mail u the porgram from which i learnt. its i access...
-
hi biscoito ur mail id pls. i wil mail u the porgram from which i learnt. its i access...
- you should be responding to the op 2) the op is a fool if they take advice or examples from you since you can't even respond to the correct post and don't know what c# is or which database edition to choose let alone the other posts you have made
I know the language. I've read a book. - _Madmatt
-
I've done more reading than you apparently. What is your point? Just because you are more comfortable with one database or edition over another does not make it the "best" choice.
I know the language. I've read a book. - _Madmatt
you've got a new fan! :laugh:
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.
-
best choice for me yar... i didnt say for all... ok u want in access? right? i wil send u via mail...
sidhu hacks wrote:
best choice for me yar
Are you the one that's going to be running the code? Storing the information? No. Your application requirements dictate the database you use, NOT your confort level with it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
hi biscoito ur mail id pls. i wil mail u the porgram from which i learnt. its i access...
Noone in their right mind is going to give you their email address.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
- you should be responding to the op 2) the op is a fool if they take advice or examples from you since you can't even respond to the correct post and don't know what c# is or which database edition to choose let alone the other posts you have made
I know the language. I've read a book. - _Madmatt
i just said i'm confortable with it man.. thats all dont start scolding me..
-
Noone in their right mind is going to give you their email address.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...how should i take it as? A compliment?
-
sidhu hacks wrote:
best choice for me yar
Are you the one that's going to be running the code? Storing the information? No. Your application requirements dictate the database you use, NOT your confort level with it.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009...since he asked for db connection i thoguht he s a noob like me.. and so i told him wat i felt thats all.... chill out...
-
Well, I have a lot of questions regarding this topic, so i'll show you some of my doubts: I'm currently developing a C# windows forms application that communicates with a access database file to store all my data. Now that my relational database is getting bigger, i'm wondering if I should make table relations inside the access file or in C#. Sometimes I have to make changes to more than one table at a time and I don´t know how and who should do these kind of transactions (access/c#). I need to use DataSets, Datareaders, Databinding, etc to do that, right? How these communication should work, I mean, best practice for this!? Hope you can help me with this. Thanks, bisc8 PS - Some good book about this?
required using System.Data.OleDb; Declaration part :) string id; string sqlQRY; OleDbConnection cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "/Data.mdb"); OleDbCommand cmd = new OleDbCommand(); OleDbDataReader dr; Open the connection in this statement cn.Open(); its like database items loading in a list cmd.CommandText = "SELECT * FROM tbladmin ORDER BY ID ASC"; cmd.Connection = cn; dr = cmd.ExecuteReader(); while (dr.Read()) { ListViewItem list = new ListViewItem(dr[0].ToString()); list.SubItems.Add(dr[1].ToString()); list.SubItems.Add(dr[2].ToString()); listView1.Items.AddRange(new ListViewItem[] { list }); } dr.Close(); this is wat i can help for now.. it tedious cant post the whole code here.. sending ur mail id wil help.... others pls gimme a break .. stop pulling my leg...