hello,
<asp:SqlDataSource ID="sourceEmployees" runat="server"
ProviderName="System.Data.SqlClient"
ConnectionString="<%$ ConnectionStrings:Northwind %>"
SelectCommand="SELECT EmployeeID, FirstName,LastName,
Title, City FROM Employees WHERE City=@City">
<SelectParameters>
<asp:Parameter Name="City"/>
</SelectParameters>
</asp:SqlDataSource>
A) I assume that when you don’t specify of which type Parameter
instance “City” is, it is automatically of type Object, which means it
can later be assigned value of any type. Thus if “City” is later ( say
inside SqlDataSource2_Selecting() event handler ) assigned a value of
a wrong type, this wrong assignment will only be detected on Sql
server, and not before ( of course Sql server will report that error
back to web server )?
B) If we create a SqlParameter instance of type NVarChar(20) and want
to pass this parameter to a stored procedure, will Ado.net pass to a
stored procedure just the value of this parameter, or will it also
somehow inform the procedure the exact type of this parameter ( which
is NVarChar(20))?
thanx