0
votes
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim AppName As String = Session("App_Name").ToString()
    Dim username As String = Session("username").ToString()
    Dim password As String = Session("password").ToString()
    Dim ds As DataSet = GContactsImport.GetGmailContacts(AppName, username, password)
    GridView1.DataSource = ds
    GridView1.DataBind()


End Sub

how do i fix it??

This is my class file

Imports Microsoft.VisualBasic Imports Google.GData.Contacts Imports Google.GData.Client Imports Google.GData.Extensions Imports Google.Contacts

Public Class Google Public Shared Function GetGmailContacts(ByVal AppName As String, ByVal Uname As String, ByVal UPassword As String) As DataSet Dim ds As New DataSet() Dim dt As New DataTable() Dim C2 As New DataColumn() C2.DataType = Type.GetType C2.ColumnName = "EmailID" dt.Columns.Add(C2) Dim rs As New RequestSettings(AppName, Uname, UPassword) rs.AutoPaging = True Dim cr As New ContactsRequest(rs) Dim f As Feed(Of Contact) = cr.GetContacts() For Each t As Contact In f.Entries For Each email As EMail In t.Emails Dim dr1 As DataRow = dt.NewRow() dr1("EmailID") = email.Address.ToString() dt.Rows.Add(dr1) Next Next ds.Tables.Add(dt) Return ds End Function

End Class

2

2 Answers

2
votes

Verify that DataSet is in scope (you may need to add an Import statement) or, alternatively, fully qualify the DataSet references in your code by replacing Dim ds As DataSet with Dim ds As System.Data.DataSet.

1
votes

You might need to reference the System.Data assembly from the GAC and Imports System.Data (at the top of your file) in order to bring the DataSet class into scope.