1
我在FormView控件如何访问参数在后面的代码
DECLARE @ResultTelID int ;
EXECUTE [CUSTOMER].[dbo].[uspUpdateClientTel]
@telephoneid
,@telephone
,@TelTypeID
,@DetailsTypeID
,@SortNo
,@ResultTelID OUTPUT
的更新命令的前两个varialbles是在选择查询 此存储过程,但我的疑问是如何传递值的更新参数从后面
protected void FrmClient_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
string strtel =((form1.FindControl("telephoneidLabel") as Label).Text)as string;
SqlConnection conTel = new SqlConnection();
conTel.ConnectionString = Convert.ToString(ConfigurationManager.ConnectionStrings["CUSTOMERConnectionString"]);
conTel.Open();
string strcmd = "SELECT tel_type_id, details_type_id, sort_no from TELEPHONE where tel_id =" + strtel;
SqlCommand cmd = new SqlCommand(strcmd , conTel);
SqlDataReader rdrTel = cmd.ExecuteReader();
while(rdrTel.Read())
{
int TeltypeID = (int)rdrTel["tel_type_id"];
int DetailTypeID = (int)rdrTel["details_type_id"];
Int16 Sort = (Int16)rdrTel["sort_no"];
//sdsClient.UpdateParameters("TelTypeID").DefaultValue = (int)rdrTel["tel_type_id"];
}
rdrTel.Close();
conTel.Close();
}
的代码,我想知道如何三个prameters的值赋给更新命令(sdsclient是为代码在SqlDataSource)
感谢您的任何建议。
THX NIRANJAN。我用 sdsClient.UpdateParameters [“TelTypeID”]。DefaultValue = rdrTel [“tel_type_id”]。ToString(); – debutante