how to retrive the database values
how to retrive the database values plz send c# code and storage procedure
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.
Jignesh TrivediPosted May 3, 2013, 1:51 AM
hi
please refer below link it might help you.
http://dbtutorials.com/advanced/using-stored-procedures-cs.aspx
http://www.akadia.com/services/dotnet_data_reader.html
http://www.c-sharpcorner.com/UploadFile/0c1bb2/inserting-from-data-into-database-using-stored-procedure-in/
Mr IndianPosted May 2, 2013, 9:20 AM
using System.Data.OleDb;
using System.Data;
namepsace whatever
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
this.WindowState = FormWindowState.Maximized;
myCon = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\...databasename.mdb");
}
OleDbConnection myCon;
OleDbCommand cmd;
OleDbDataAdapter adapter;
DataSet ds;
private void btnGetData_Click(object sender, EventArgs e)
{
adapter = new OleDbDataAdapter("select * from SomeTableName", myCon);
ds = new DataSet();
adapter.Fill(ds, "TableName");
adapter.Update(ds, "TableName");
txtID.Text = ds.Tables[0].Rows[rno][0].ToString();
CBTitle.Text = ds.Tables[0].Rows[rno][2].ToString();
}
}
Satyapriya NayakPosted May 1, 2013, 9:33 AM
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 Insert_Update_Delete_DataGridView
{
public partial class Form1 : Form
{
string ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["dsn"];
OleDbCommand com;
OleDbDataAdapter oledbda;
string str;
DataSet ds;
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 employee";
com = new OleDbCommand(str, con);
oledbda = new OleDbDataAdapter(com);
ds = new DataSet();
oledbda.Fill(ds, "employee");
dataGridView1.DataMember="employee";
dataGridView1.DataSource = ds;
con.Close();
}
}