-
C# (
http://www.daniweb.com/forums/forum61.html)
| Jx_Man | Apr 11th, 2008 5:38 pm | |
| Dislay Data on datagrid Just post simple code. Give a feedback if it helps u :) |
using System;
using System.Collection.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void cmdtam_Klik(object sender, EventArgs e)
{
string cstr;
cstr = "data source=jery;initial catalog=latihan;uid=sa;pwd=sri";
SqlConnection con1 = new SqlConnection(cstr);
con1.Open();
SqlCommand com1 = new SqlCommand();
com1.Connection = con1;
com1.CommandType = CommandType.Text;
com1.CommandText = "select * from customer"
DataSet ds1 = new DataSet();
SqlDataAdapter adp1 = new SqlDataAdapter(com1);
adp1.Fill(ds1,"customer");
grd1.DataMember = "customer";
con1.Close();
}
}
}
| majestic0110 | May 12th, 2008 9:09 am | |
| Nice snippet :) |
| Jx_Man | Jun 3rd, 2008 2:11 am | |
| thx majestic0110 |
| kalekau | Jul 14th, 2008 6:57 am | |
| Pl Help me for query related to update date in SQL Server2005
in C#.NET |
| oscprofessional | Aug 18th, 2008 4:19 am | |
| hey...buddie,
did u help me ,i want to connect remote database(mysql) with c#.......
and update database using datagrid in c# |
| All times are GMT -4. The time now is 10:39 am. | |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC