결과 뒤에 예외가 있습니다. sqlcomm
이 (가) doTable
기본 테이블 문자열 'blTableName'을 찾으려고하는 이유는 무엇입니까? 나는 sqlcomm
에이 이름을 보내지 않으므로 sqlcomm
SQL 쿼리를 실행해야합니다.Sqlcommand going cahtch
내가 시도 어딘가에 저장 프로 시저를 수정하려면 내가 잘못 쓴 문제를 찾을 수 없습니다
string t_table_name = "TableName";
try
{
BindingList<doTable> bl = new
daTable().getTable(CoreStatic.s_SqlServerConfigLocal, new doTable() { table_ = t_table_name, TablePK = p_doWcfTicketQueue.TablePK, TableBFK =
CoreStatic.s_CurrentBPK }, Enums.DynamicType.BindingList);
foreach (doTable item_odoTable in bl)
{
SqlConnection SqlConn = new SqlConnection(blabla);
SqlCommand sqlcomm = new SqlCommand("TableUpdate", SqlConn);
SqlConn.Open();
sqlcomm.CommandType = CommandType.StoredProcedure;
sqlcomm.Parameters.Add(new SqlParameter()
{ ParameterName = "@table", SqlDbType = SqlDbType.NVarChar, Direction = ParameterDirection.Input, Value = t_table_name });
sqlcomm.Parameters.Add(new SqlParameter()
{ ParameterName = "@TablePK", SqlDbType = SqlDbType.UniqueIdentifier, Direction = ParameterDirection.Input, Value = item_odoTable.TablePK });
//is that possible to see sqlcomm sql query? like" insert into TableName... bla bla "
result = sqlcomm.ExecuteNonQuery();
}//try
catch (SqlException exc)
{
//exc = invalid object name 'blTableName'
}
당신이'TableUpdate' SP를 보여줄 수있는 SQL 쿼리로 보내는 것을보고 싶어? –
예외 메시지 = "잘못된 개체 이름 'blTableName'." SP : @table (nvharchar (128), 입력, 기본값 아님) @TablePK (고유 식별자, 입력, 기본값 아님) –
SQL Server와 함께 제공되는 SSMS (SQL Server Management Studio)를 사용하십시오. 이 도구에는 테이블과 저장 프로 시저를 볼 수있는 탐색기가 있습니다. 데이터베이스의 저장 프로 시저 TableUpdate를 조사해야합니다. – jdweng