在asp.net中调用存储过程时,给参数指定sqldbtype.nvarchar类型就可以了。
即如你上面写的,@adrlin1 参数为nvarchar, 赋值后,执行时,实际上相当于以 N前辍。得不到结果,那你要查一下customerName 变量的值。

解决方案 »

  1.   

     string CustomerName= "批发商";  //笔误?加上CustomerName
            DataTable dt = new DataTable(); 
            SqlCommand comm = new SqlCommand("sp_GetCustomerInfo", conn.Conn); 
            comm.CommandType = CommandType.StoredProcedure; 
            comm.Parameters.Add("@ADRLIN1", SqlDbType.NVarChar, 500); 
            comm.Parameters["@ADRLIN1"].Value = CustomerName; //你CustomerName哪里来的?
            comm.Parameters["@ADRLIN1"].Direction = System.Data.ParameterDirection.Input; 
            SqlDataAdapter adapter = new SqlDataAdapter(comm); 
            adapter.Fill(dt); 
            if (conn.Conn.State == ConnectionState.Open) 
            { 
                conn.Conn.Close(); 
            } 
    ------------------------
      是否是中间字符集转换的问题,
      使用sql profiler 看看你页面传到服务器时,
      "批发商"转换成什么代码了...