Click here to Skip to main content
15,887,966 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeFile="ScriptFile.aspx.cs" Inherits="ScriptFile" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:treeview ID="Treeview1" runat="server"></asp:treeview>
</div>
</form>
</body>
</html>


C#
using System;
using System.Data;
using System.IO;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MySql.Data.MySqlClient;

public partial class ScriptFile : System.Web.UI.Page
{
    string str;
    MySqlCommand com;
    
    protected void Page_Load(object sender, EventArgs e)
    {
        bindtreeview();
    }

    void bindtreeview()
    {

        MySqlConnection con = new MySqlConnection("Data Source=localhost;Database=utaf;User ID=root;Password=admin;");


        con.Open();
        str = "Select * from scriptgeneratetable";
        com = new MySqlCommand(str, con);
        MySqlDataReader reader = com.ExecuteReader();
        com.Dispose();
        string[,] ParentNode = new string[100, 2];
        int count = 0;
        while (reader.Read())
        {
            ParentNode[count, 0] = reader.GetValue(reader.GetOrdinal("Foldername")).ToString();
            ParentNode[count++, 1] = reader.GetValue(reader.GetOrdinal("textfilename")).ToString();

             
        }
        reader.Close();
        
    }
     
    protected void MyTree_SelectedNodeChanged(object sender, EventArgs e)
    {

    }
}
Posted
Updated 26-Sep-13 2:03am
v3

1 solution

Assuming that you want to populate all the User Tables in your current database, you should use the following query -

SELECT * FROM SYSOBJECTS WHERE xtype='U'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900