110,566
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using QYMessage.Mode;
namespace QYMessage
{
public partial class Message : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
CommandConnection();
}
}
private void CommandConnection()
{
try
{
SqlConnection sqlconn = new SqlConnection();
sqlconn.ConnectionString = "Data Source=PC2013051514PMC;Initial Catalog=QYMessage;Integrated Security=True";
SqlCommand sqlComand = new SqlCommand();
sqlComand.CommandType = CommandType.Text;
sqlComand.Connection = sqlconn;
SqlDataReader sqlDr = sqlComand.ExecuteReader();
string sqlstr = "select RZXQ.id,RZXQ.a7,RZXQ.a8,dbsmeqdEManage.dbo.tbCPerPostion.ppid,RZXQ.a10,RZXQ.a11,RZXQ.a1,RZXQ.a3,RZXQ.a4,dbsmeqdEManage.dbo.tbCAreaCity.acid"
+" from RZXQ left outer join dbsmeqdEManage.dbo.tbCPerPostion on RZXQ.a9 = dbsmeqdEManage.dbo.tbCPerPostion.ppname "
+"left outer join dbsmeqdEManage.dbo.tbCAreaCity on RZXQ.a2 = dbsmeqdEManage.dbo.tbCAreaCity.acname";
SqlDataAdapter sda = new SqlDataAdapter(sqlstr,sqlconn);
DataSet ds = new DataSet();
sda.Fill(ds, "qymessage");
gwmessage.DataSource = ds.Tables[0];
gwmessage.DataBind();
sqlDr.Close();
sqlComand.Dispose();
sqlconn.Close();
}
catch (Exception e)
{
throw e;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
SqlConnection sqlconn = new SqlConnection();
sqlconn.ConnectionString = "Data Source=PC2013051514PMC;Initial Catalog=dbsmeqdEManage;Integrated Security=True";
DataSet ds = new DataSet();
for (int i = 0; i < ds.Tables[0].Rows.Count;i++ )
{
}
}
catch(Exception ex)
{
throw ex;
}
}
}
}