Hi,
Can I use MS Access as a Database with c# windows application, where I want to install this product on a server connected to 15 more computers??
M confused...Plz help!!
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ibrahim ErsoyPosted Jul 2, 2012, 1:19 PM
its not about visual studio version but .net framework version!
Simply open the project solution in Visual Studio 2008. it will tell you to update it to higher .net framework version.if you want you can update it but there are code changes so it might not work sometimes.
And have a look around Satyapriya Nayak's solution.Shows you a sample project using MS Access Database in a C# application.
Any more questions,i'll be here to answer.
Hope it helps
Satyapriya NayakPosted Jul 2, 2012, 4:03 AM
Look at this example below
Sum the values of the datagridview cell columns.
App.config
Form1.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace Sum_in_datagridview
{
public partial class Form1 : Form
{
string ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["dsn"];
OleDbCommand com;
OleDbDataAdapter oledbda;
DataSet ds;
string str;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
bindgrid();
}
private void bindgrid()
{
OleDbConnection con = new OleDbConnection(ConnectionString);
con.Open();
str = "select * from product";
com = new OleDbCommand(str, con);
oledbda = new OleDbDataAdapter(com);
ds = new DataSet();
oledbda.Fill(ds, "product");
dataGridView1.DataMember = "product";
dataGridView1.DataSource = ds;
con.Close();
}
private void btn_sum_Click(object sender, EventArgs e)
{
int sum = 0;
for (int i = 0; i < dataGridView1.Rows.Count; ++i)
{
sum += Convert.ToInt32(dataGridView1.Rows[i].Cells[1].Value);
}
label1.Text = "Total sum is:"+sum.ToString();
}
}
}
Thanks
garimaPosted Jul 2, 2012, 3:06 AM
I had one more question....Can i execute a project developed in visual studio 2005 in visual studio 2009...If yes...how do i do it....Just creating a DSN would work???
Ibrahim ErsoyPosted Jul 1, 2012, 2:29 PM
Hope this helps