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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ibrahim ErsoyRank #106 · 20.6K reputationPosted Jul 1, 2012, 10:29 AM EDT
Hope this helps
garima3 reputationPosted Jul 1, 2012, 11:06 PM EDT
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???
Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 2, 2012, 12:03 AM EDT
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
Ibrahim ErsoyRank #106 · 20.6K reputationPosted Jul 2, 2012, 9:19 AM EDT
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