using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using HPCIMTS.PublicClass;
namespace HPCIMTS_admin
{
public partial class frmPatienttracking : Form
{
BindingNavigator patientsBindingNavigator = new BindingNavigator();
BindingSource patientsBindingSource = new BindingSource();
public frmPatienttracking()
{
InitializeComponent();
}
private void frmPatienttracking_Load(object sender, EventArgs e)
{
string connectString = "Data Source=.;Initial Catalog=HPCIMTS;Integrated Security=SSPI";
SqlConnection connection = new SqlConnection();
connection.ConnectionString = connectString;
connection.Open();
SqlCommand command = new SqlCommand("Select*From vw_病人查询", connection);
SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
DataSet ds = new DataSet("HPCIMTS vw_病人查询");
ds.Load(reader,LoadOption.OverwriteChanges,new string[] { "vw_病人查询" });
this.txt_Pno.DataBindings.Add(new Binding("Text",this.patientsBindingSource,"病案号",true));
}
}
}
应该怎么改?
想达到这样的效果:
这是我做的界面