using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Data.Odbc;
using System.Data.OleDb;using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace 实验八
{
public partial class Form1 : Form
{
static string connectionString = @"DNS=Dong;DBQ=H:\school\work\SQL\第08次上机报告\PZdb.mdf"; public Form1()
{
InitializeComponent();
} private void first_Click(object sender, EventArgs e)
{
OdbcConnection conObj = new OdbcConnection(connectionString);
conObj.Open(); OdbcCommand command = new OdbcCommand("select * form Student",conObj);
OdbcDataReader reader = command.ExecuteReader(); if (reader.Read())
{
information.Text = reader.GetString(0);
information.Text = reader.GetString(1);
information.Text = reader.GetString(2);
information.Text = reader.GetString(3);
information.Text = reader.GetString(4);
}
reader.Close();
conObj.Close();
} }
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Data.Odbc;
using System.Data.OleDb;using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace 实验八
{
public partial class Form1 : Form
{
static string connectionString = @"DNS=Dong;DBQ=H:\school\work\SQL\第08次上机报告\PZdb.mdf"; public Form1()
{
InitializeComponent();
} private void first_Click(object sender, EventArgs e)
{
OdbcConnection conObj = new OdbcConnection(connectionString);
conObj.Open(); OdbcCommand command = new OdbcCommand("select * form Student",conObj);
OdbcDataReader reader = command.ExecuteReader(); if (reader.Read())
{
information.Text = reader.GetString(0);
information.Text = reader.GetString(1);
information.Text = reader.GetString(2);
information.Text = reader.GetString(3);
information.Text = reader.GetString(4);
}
reader.Close();
conObj.Close();
} }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货