Current location: Hot Scripts Forums » Programming Languages » ASP.NET » converting code into

converting code into

  #1 (permalink)  
New Member
Join Date: Sep 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
converting code into

I am trying to convert a code into that loads tables in combobx and displays selected table in datagridview .
i got 'DisplayMember is not member of System.Web.UI.dropdownlist and variable conflicts with property adapter during debug.
any help would be appriciated .
 Imports System.Data.OleDb
Public Class WebForm1
 Inherits System.Web.UI.Page
    Private con As New OleDbConnection("  Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\dtb.accdb;Jet OLEDB:Database Password=****  ")
    Private adapter As New OleDbDataAdapter(String.Empty, Me.con)
    Private data As DataTable
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.DropDownList1.DisplayMember = "TABLE_NAME"
        Me.DropDownList1.ValueMember = "TABLE_NAME"
        Me.DropDownList1.DataSource = Me.con.GetSchema("TABLES", New String() {Nothing, Nothing, Nothing, "TABLE"})
    End Sub


    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList1.SelectedIndexChanged
        If Me.DropDownList1.SelectedItem IsNot Nothing Then
   = New DataTable
            Me.adapter.SelectCommand.CommandText = String.Format("SELECT * FROM [{0}]", Me.DropDownList1.SelectedValue)
            Me.GridView1.DataSource = Nothing
            Me.GridView1.DataSource =
        End If
    End Sub
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        ' Dim thisConnection As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Dtb.accdb")

        If IsNot Nothing Then
            Dim builder As New OleDbCommandBuilder(Me.adapter)
        End If
Reply With Quote

Featured Marketplace Scripts (view more)




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for reading a text file xDreamer PHP 7 06-09-11 01:22 AM
PHP Code Deployment Tips danieljames123 PHP 0 06-08-11 12:23 AM
PHP inside JavaScript? pikaz JavaScript 20 07-10-10 12:55 AM

All times are GMT -5. The time now is 01:59 AM.
vBulletin® Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.