我收到此编译错误消息.我该如何解决?
错误28'WindowsFormsApplication1.SqlCommand'不包含'Parameters'的定义,也没有扩展方法'Parameters'接受类型为'WindowsFormsApplication1.SqlCommand'的第一个参数'(您是否缺少using指令或程序集引用?) C:\ Users\cofex\Desktop\Gestion de salair - pompier - ARAB - Copy - Copy\Gestion de salair - pompier - ARAB - Copy - Copy\WindowsFormsApplication1\Classes\employeurclass.cs 152 26 WindowsFormsApplication1
在这段代码上:
SqlCommand command = new SqlCommand (query, _connection); // Form1.connection.Open();
command.Parameters.AddWithValue("@N_Securite_Social", N_Securite_Social);
command.Parameters.AddWithValue("@N_CCP", N_CCP);
Run Code Online (Sandbox Code Playgroud)
加
using System.Data;
using System.Data.SqlClient;
Run Code Online (Sandbox Code Playgroud)
名称空间到您的文件