: I have "using System.Data.Sqlclient" : and "using System.Data" and etc : Let me post the whole Page_Load method and see if there's anything wrong. : It's a really simple method though. : private void Page_Load(........) : { : SqlConnection conn = new SqlConnection(........); : SqlCommand cmd = new SqlCommand (.......); : SqlDataAdapter adp = new SqlDataAdapter(); //error this line : adp.SelectCommand = cmd;
|
a********y 发帖数: 20 | 12 namespace HowTo.Samples.ADONET { using System; using System.Data.SqlClient; public class adooverview2 { public static void Main() { adooverview2 myadooverview2 = new adooverview2(); myadooverview2.Run(); } public void Run() { string Message = null; SqlConnection myConnection = new SqlConnection("server=(local)\\NetSDK;T rusted_Connection=yes;database=northwind"); SqlCommand mySqlCommand = new SqlCommand("INSERT INTO Customers (Custome rId, CompanyName, ContactName,
【在 s***y 的大作中提到】 : I have "using System.Data.Sqlclient" : and "using System.Data" and etc : Let me post the whole Page_Load method and see if there's anything wrong. : It's a really simple method though. : private void Page_Load(........) : { : SqlConnection conn = new SqlConnection(........); : SqlCommand cmd = new SqlCommand (.......); : SqlDataAdapter adp = new SqlDataAdapter(); //error this line : adp.SelectCommand = cmd;
|
C****n 发帖数: 2324 | 13 is this System.Data.DataClient.SqlDataAdapter wrong? It should be System.Data.SqlClient.SqlDataAdapter. Which version of VS do you use? You'd better paste your whole file here. I feel AsianHotty's assumption is pretty reasonable. :-)
【在 s***y 的大作中提到】 : 在程序中写下SqlDataAdapter adp = new SqlDataAdapter : 编译时出错,说是 : "System.Data.DataClient.SqlDataAdapter" denotes : a 'class' which is not valid in the given context. : 哪位大侠知道是怎么回事?望不吝赐教。先行谢过
|
e***g 发帖数: 158 | 14 how come a compilation be a problem, hehe |
a**y 发帖数: 335 | 15 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I think i use System.Data.SqlClient.SqlDataAdapter
【在 s***y 的大作中提到】 : 在程序中写下SqlDataAdapter adp = new SqlDataAdapter : 编译时出错,说是 : "System.Data.DataClient.SqlDataAdapter" denotes : a 'class' which is not valid in the given context. : 哪位大侠知道是怎么回事?望不吝赐教。先行谢过
|
k*****y 发帖数: 221 | 16 .NET有时候会报错行,至少我已经遇到过一次了。 明明是类型不匹配,它告诉我找不到邮CMO Object. 如果实在在那行找不到错误,最好到其他位置也看看。
【在 s***y 的大作中提到】 : But I have the "()".confused
|