Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > SqlDataAdapter Problem Overload

Reply
Thread Tools

SqlDataAdapter Problem Overload

 
 
jm
Guest
Posts: n/a
 
      10-14-2003
This code:

<%@ Page Language="vb" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.Odbc" %>
<%@ import Namespace="System.Data.SqlClient"%>
<script runat="server">

Sub Page_Load(Sender As Object, E As EventArgs)

Dim DS As DataSet
Dim MyCommand As SqlDataAdapter

Dim MyConnection As Odbc.OdbcConnection
Dim sConnString As String = "Dsn=test;" & _
"Uid=root;" & _
"Pwd="



MyConnection = New Odbc.OdbcConnection(sConnString)

MyCommand = New SqlDataAdapter("select * from users",
MyConnection)

DS = new DataSet()
MyCommand.Fill(ds, "users")

MyDataGrid.DataSource=ds.Tables("users").DefaultVi ew
MyDataGrid.DataBind()
End Sub

</script>
<html>
<head>
</head>
<body>
<h3><font face="Verdana">Simple Select to a DataGrid
Control</font>
</h3>
<ASPataGrid id="MyDataGrid" EnableViewState="false"
HeaderStyle-BackColor="#aaaadd" Font-Size="8pt" Font-Name="Verdana"
CellSpacing="0" CellPadding="3" ShowFooter="false" BorderColor="black"
BackColor="#ccccff" Width="700" runat="server"></ASPataGrid>
</body>
</html>


Gives this error:


Compiler Error Message: BC30518: Overload resolution failed because no
accessible 'New' can be called with these arguments:

Source Error:



Line 19: MyConnection = New Odbc.OdbcConnection(sConnString)
Line 20:
Line 21: MyCommand = New SqlDataAdapter("select * from users",
MyConnection)
Line 22:
Line 23: DS = new DataSet()


What does this mean? Why doesn't it like these arguments? How can I
fix it? Thank you for any help.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SqlDataAdapter, BC30519: Overload resolution failed because no acc =?Utf-8?B?Q2FpbGlu?= ASP .Net 0 09-09-2005 01:57 PM
Peculiar problem with refresh of sqldataadapter re: stored procedures Randy Smith ASP .Net 0 04-28-2005 05:44 PM
function overload (not operator overload) Ying-Chieh Liao Perl Misc 3 10-11-2004 11:24 AM
How use the overload of>> (or<<) of a class in the overload of << and >> of another class? Piotre Ugrumov C++ 3 01-25-2004 08:08 PM
How to update the Database by using SqlDataAdapter object in asp.net? zhaoJian ASP .Net 0 11-06-2003 03:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57