2019/4/10 9:22:22
conn.Open();
//建立sql字符串
string sql="select * from reg where name='"+name+"'";
SqlDataReader dr;
SqlCommand cmd=new SqlCommand(sql,conn);
dr=cmd.ExecuteReader();
//保留用(yòng)戶注冊與否信息
bool isRegUserExist=dr.Read();
//關閉DataReader
dr.Close();
//取得用(yòng)戶名的(de)密碼
//保留用(yòng)戶名+密碼同時存在信息
bool isBothExist=drBoth.Read();
//關閉DataReader
drBoth.Close();
conn.Close();
//判斷用(yòng)戶是否注冊
//判斷用(yòng)戶名與密碼是否一緻
//IsExistNews函數:判斷新聞表中是否仍存有(yǒu)此用(yòng)戶發布過的(de)新聞(下轉第1355頁)
(上(shàng)接第1314頁)
public bool IsExistNews()
{
SqlConnection conn=new SqlConnection();
conn.ConnectionString="server=(local);uid=sa;pwd=;database=jxdb";
conn.Open();
name=TextBoxName.Text.Trim();
//新聞表中是否存在此用(yòng)戶
string sql="select * from news where Name='"+name+"'";
DataSet ds=new DataSet();
SqlDataAdapter da=new SqlDataAdapter(sql,conn);
da.Fill(ds,"list");
//取得新聞行(xíng)數
int count=ds.Tables["list"].Rows.Count;
//該用(yòng)戶是否發布過新聞
if(count==0)
return false;
else
return true;
conn.Close();
}
最後給出系統後端數據存儲方案:兩個(gè)必需的(de)數據表,一是數據表News包含的(de)字段有(yǒu):編号、姓名、标題、關鍵字、内容、類型、來源部門和(hé)日期。(剩餘3127字)
深圳市南山區南山街(jiē)道南海(hǎi)大(dà)道西(xī)桂廟路(lù)北陽光(guāng)華藝大(dà)廈1棟4F、4G-04
咨詢電話(huà):136 8237 6272
大(dà)客戶咨詢:139 0290 5075
業(yè)務QQ:195006118
技術(shù)QQ:179981967