c# 必须声明标量变量@ 可是已经声明了啊
string sql = "insert into commodity values(@photo,@number, @name,@ pwd, @mail,@sex,@call, @college,@major)";
SqlCommand com = new SqlCommand(sql1, DBhelper.con);
// com.Parameters.Add("@photo", SqlDbType.Image).Value =file ;
com.Parameters.AddWithValue("@photo", file);
com.Parameters.AddWithValue("@number", number);
com.Parameters.AddWithValue("@name", name);
com.Parameters.AddWithValue("@pwd", pwd);
com.Parameters.AddWithValue("@mail", mail);
com.Parameters.AddWithValue("@sex", sex);
com.Parameters.AddWithValue("@call", call);
com.Parameters.AddWithValue("@college", college);
com.Parameters.AddWithValue("@major", major);
SqlCommand com = new SqlCommand(sql1, DBhelper.con);
// com.Parameters.Add("@photo", SqlDbType.Image).Value =file ;
com.Parameters.AddWithValue("@photo", file);
com.Parameters.AddWithValue("@number", number);
com.Parameters.AddWithValue("@name", name);
com.Parameters.AddWithValue("@pwd", pwd);
com.Parameters.AddWithValue("@mail", mail);
com.Parameters.AddWithValue("@sex", sex);
com.Parameters.AddWithValue("@call", call);
com.Parameters.AddWithValue("@college", college);
com.Parameters.AddWithValue("@major", major);
...全文
相关推荐
C#调用VC DLL知识点
**声明外部方法**:在C#源代码中,你需要使用`[DllImport]`特性来声明一个外部方法。这个特性告诉编译器该方法是在DLL中定义的而非本地代码。
perl基本语法
每种变量都有一个印记(符号):标量是 $,数组是 @,哈希是 %。* 标量(Scalar):可以存储字符串、整数、浮点数与各种对象的引用。
c# 动态链接库
DllImport属性通常用于声明外部方法,其基本形式如下:```csharp[DllImport("DLL文件名", 返回变量类型)]extern 返回变量类型 方法名称(参数列表);```在这个声明中
Rust for C#/.NET 开发人员 中文 pdf
- **C#/.NET**:Lambda表达式使用`=>`符号。##### 10. 变量- **Rust**:变量声明使用`let`关键字。
C#调用外部dll.pdf
封送数字和逻辑标量: - 调用非托管DLL时,C#会自动处理某些数据类型的封送,但有时可能需要手动处理,以确保与非托管代码的数据表示一致。


