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