Ejemplo n.º 1
0
 public bool UpdateData()
 {
     myChatLineData data=new myChatLineData();
     List<SqlParameter> tempAL = new List<SqlParameter>();
     SqlParameter tempP;
     tempP = new SqlParameter();
     tempP.ParameterName = "@ChatLineID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myChatLineID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@UserID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myUserID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@GameRoomID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myGameRoomID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@ChatLineContent";
     tempP.Size = 1200;
     tempP.SqlDbType = SqlDbType.VarChar;
     tempP.Value = myChatLineContent;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@TimePosted";
     tempP.Size = 12;
     tempP.SqlDbType = SqlDbType.DateTime;
     tempP.Value = myTimePosted;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     data.RunProcedure("csp_UpdateChatLine", tempAL);
     return true;
 }
Ejemplo n.º 2
0
 public bool InsertData()
 {
     myChatLineData data=new myChatLineData();
     List<SqlParameter> tempAL = new List<SqlParameter>();
     SqlParameter tempP;DataSet tempDS;
     tempP = new SqlParameter();
     tempP.ParameterName = "@UserID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myUserID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@GameRoomID";
     tempP.Size = 4;
     tempP.SqlDbType = SqlDbType.Int;
     tempP.Value = myGameRoomID;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@ChatLineContent";
     tempP.Size = 1200;
     tempP.SqlDbType = SqlDbType.VarChar;
     tempP.Value = myChatLineContent;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempP = new SqlParameter();
     tempP.ParameterName = "@TimePosted";
     tempP.Size = 12;
     tempP.SqlDbType = SqlDbType.DateTime;
     tempP.Value = myTimePosted;
     tempP.Direction = ParameterDirection.Input;
     tempAL.Add(tempP);
     tempDS = data.RunProcedure("csp_InsertChatLine", tempAL);
     myChatLineID= int.Parse(tempDS.Tables[0].Rows[0][0].ToString());
     tempDS.Dispose(); return true;
 }