-
大小: 0.25M文件類(lèi)型: .zip金幣: 1下載: 0 次發(fā)布日期: 2021-02-26
- 語(yǔ)言: C#
- 標(biāo)簽:
資源簡(jiǎn)介
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; //Download by http://down.liehuo.net using System.Data.SqlClient; namespace Case05_12 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { try { //生成連接數(shù)據(jù)庫(kù)字符串 string ConStr = "data source=.;database=ljp;uid=sa;pwd=123"; //定義SqlConnection對(duì)象實(shí)例 SqlConnection con = new SqlConnection(ConStr); //定義Select查詢語(yǔ)句 string Sql = "select*from biaoge"; SqlDataAdapter ada = new SqlDataAdapter(Sql, con); DataSet ds = new DataSet(); //定義DataSet對(duì)象實(shí)例 ada.Fill(ds); //連接數(shù)據(jù)表格,顯示數(shù)據(jù) this.dataGridView1.DataSource = ds.Tables[0].DefaultView; } catch { return; } } private void button2_Click(object sender, EventArgs e) { this.Close(); Application.Exit(); } } }
代碼片段和文件信息
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;
//Download?by?http://down.liehuo.net
using?System.Data.SqlClient;
namespace?Case05_12
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????try
????????????{
????????????????//生成連接數(shù)據(jù)庫(kù)字符串
????????????????string?ConStr?=?“server=(local);user?id=myzf;pwd=123456;database=MysqlData“;
????????????????//定義SqlConnection對(duì)象實(shí)例??
????????????????SqlConnection?con?=?new?SqlConnection(ConStr);
????????????????//定義Select查詢語(yǔ)句
????????????????string?SqlStr?=?“select?*?from?應(yīng)付賬“;
????????????????SqlDataAdapter?ada?=?new?SqlDataAdapter(SqlStr?con);
????????????????DataSet?ds?=?new?DataSet();????//定義DataSet對(duì)象實(shí)例
????????????????ada.Fill(ds
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????目錄???????????0??2014-09-21?09:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\
?????目錄???????????0??2014-09-21?09:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\
?????目錄???????????0??2014-09-21?09:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\
?????目錄???????????0??2014-09-21?09:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\
?????文件?????????917??2008-06-11?21:14??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12.sln
?????文件???????15872??2011-01-10?16:19??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12.suo
?????文件????????3764??2008-06-11?21:25??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Case05_12.csproj
?????文件????????1459??2011-01-10?16:18??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Form1.cs
?????文件????????5004??2008-06-11?21:27??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Form1.Designer.cs
?????文件????????5814??2008-06-11?21:27??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Form1.resx
?????文件?????????526??2011-01-10?16:18??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Program.cs
?????目錄???????????0??2014-09-21?09:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Properties\
?????文件????????1374??2008-06-11?21:14??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Properties\AssemblyInfo.cs
?????文件????????2868??2008-06-11?21:14??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Properties\Resources.Designer.cs
?????文件????????5612??2008-06-11?21:14??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Properties\Resources.resx
?????文件????????1094??2008-06-11?21:14??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Properties\Settings.Designer.cs
?????文件?????????249??2008-06-11?21:14??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Backup\Case05_12\Properties\Settings.settings
?????目錄???????????0??2014-09-21?09:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\
?????文件?????????917??2014-09-21?00:32??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12.sln
?????文件???????22528??2014-09-21?11:03??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12.suo
?????目錄???????????0??2014-09-21?09:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\bin\
?????目錄???????????0??2014-09-21?09:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\bin\Debug\
?????文件????????9728??2014-09-21?10:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\bin\Debug\Case05_12.exe
?????文件???????22016??2014-09-21?10:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\bin\Debug\Case05_12.pdb
?????文件???????11608??2014-09-21?10:54??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\bin\Debug\Case05_12.vshost.exe
?????文件?????????490??2010-03-17?22:39??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\bin\Debug\Case05_12.vshost.exe.manifest
?????目錄???????????0??2014-09-21?00:32??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\bin\Release\
?????文件????????5462??2014-09-21?00:32??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\Case05_12.csproj
?????文件?????????452??2014-09-21?00:32??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\Case05_12.csproj.user
?????文件????????1434??2014-09-21?10:52??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\Form1.cs
?????文件????????4997??2014-09-21?10:53??C#動(dòng)態(tài)連接數(shù)據(jù)庫(kù)\Down.LieHuo.Net\Case05_12\Form1.Designer.cs
............此處省略34個(gè)文件信息
評(píng)論
共有 條評(píng)論