私はこのsp'Update_driver_Position 'を'temptbl'(varchar型)というパラメータで指定し、spで他のテーブルのデータを'temptbl 'に選択します。私はビジュアルスタジオでspを実行する方法を知っていますが、私は'temptbl 'からデータを選択する方法を知らない(sqldatareaderにtemptblの日付を取得する)。私はどのようにストアドプロシージャを実行し、Visual Studioのテンポラリテーブルから選択できますか?
これは、これはあなたが私が言うに戻った読者からの列のデータを取得する方法に
using (SqlCommand cmd = new SqlCommand())
{
string text = "Update_driver_Position";
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = text;
SqlParameter retval = cmd.Parameters.Add("@Temptbl", SqlDbType.VarChar);
retval.Direction = ParameterDirection.Output;
cmd.Connection = this.GetConnection();
cmd.Connection.Open();
cmd.ExecuteNonQuery();
SqlDataReader reader = (cmd.Parameters["@Temptbl"]);
while (reader.Read())
{
//...
}
}
私はどのように私は「## temptbl」cmd.Parameters.Add(「@のVendorName」、SqlDbType.VarChar)とストアドプロシージャの原因にを渡すことができる、ということを知っている私たちは、パラメータではない一時テーブルを追加します。 –