How do I solve this compile error? [closed]

£可爱£侵袭症+ 提交于 2019-12-13 11:31:17

问题


I'm getting this compile error message. How do I solve it?

Error 28 'WindowsFormsApplication1.SqlCommand' does not contain a definition for 'Parameters' and no extension method 'Parameters' accepting a first argument of type 'WindowsFormsApplication1.SqlCommand' could be found (are you missing a using directive or an assembly reference?) 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

On this code:

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); 

回答1:


add

using System.Data;
using System.Data.SqlClient;

namespace to your file



来源:https://stackoverflow.com/questions/10480605/how-do-i-solve-this-compile-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!