public void Bind()
{
try
{
string strSql = "select Sex from dbo.Student group by Sex"
SqlCommand cmd = new SqlCommand(strSql, DBHelpper.conn)
DBHelpper.conn.Open()
SqlDataReader dataReader = cmd.ExecuteReader()
string sex = ""
while (dataReader.Read())
{
sex = (string)dataReader[0]
cboSex.Items.Add(sex)
}
dataReader.Close()
}
catch (Exception ex)
{
MessageBox.Show(" *** 作数据库出错")
Console.WriteLine(ex.Message)
}
finally
{
DBHelpper.conn.Close()
}
string StrSql = "select StudentID,LoginId,StudentName,StudentNO,Sex,Phone,Address,JobWanted from dbo.Student"
dataAdapter = new SqlDataAdapter(StrSql,DBHelpper.conn)
dataAdapter.Fill(dataSet, "Student")
dgvStudent.DataSource = dataSet.Tables["Student"]
}
然后在Form_load与刷新按钮里调用此方法
Bind()
然后在修改事件里的下后面调用Bind()方法,即修改完毕就刷新,不用再点刷新按钮
很简单。。。刷新网页。
访问网页是 基于HTTP协议,而 HTTP 协议 一般是基于TPC/IP 协议的。
你可以编写一个程序,类似 Telnet 程序,按照HTTP协议,
发送 HTTP Get 或 Post 方式到指定的URL地址
访问具体的WEB应用程序(即:网页)。
然后WEB服务器会返回具体网页数据。
然后分析网页的数据元素。
估计VB不知道,用JAVA的话核心代码就那么几十行。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)