|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
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: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: 244: 245: 246: 247: 248: 249: 250: 251: 252: 253: |
//****************************************************************
//cmsSchema.aspx.cs Code behind Page
//****************************************************************
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data.Common;
using System.IO;
using System.Text;
using System.Drawing;
using System.Data.OleDb;
public partial class cmsSchema : System.Web.UI.Page
{
public string sSql;
public string sDir;
public bool bDatabaseExists = false;
public bool bTableExists = false;
public string sDBServer = System.Net.Dns.GetHostName();
public string cboSQLServers = System.Net.Dns.GetHostName();
public string sDataSource = "fuertemon";
public object sDBServerProvider = "\\sqlexpress";
public string sUSERid = "sa";
public string sDBName = "Master";
public string sDBPass = "h6web97";
public string TempTable = "Employ";
public string TempProcedure = "UpdateEmployDetails";
public string strTable;
public string strProcedure;
public SqlConnection connection;
public string ConnectionString;
public string MsgBoxDatabase = null;
public string MsgBoxTable = null;
public string MessageBox = null;
public string MessageBoxProcedure = null;
public DataView Source;
public DataSet Ds;
public string sOutput;
public string strResponse;
public int i;
public string tablePage;
public string dbName;
public string strCountdb;
public string dbTableName;
public string oTableName;
public string strTbleCount;
public string odbName;
public string odbTableName;
protected void Page_Load(object sender, System.EventArgs e)
{
HttpContext _Context = HttpContext.Current;
if (Page.IsPostBack)
{
}
if (!Page.IsPostBack)
{
BindGrid();
}
//***************************************************************
//Response.Write("1#" + Request["tablePage"]);
LabelPage.Text = (Request["tablePage"]);
//***************************************************************
SqlConnection sConn = null;
SqlDataReader sReader = null;
SqlCommand sComm = null;
string sMyString = null;
Session["connStringValue"] = "server=" + sDBServer + sDBServerProvider + ";uid=" + sUSERid + ";pwd=" + sDBPass;
sMyString = Session["connStringValue"] + ";Initial Catalog=" + sDBName;
sConn = new System.Data.SqlClient.SqlConnection(Session["connStringValue"].ToString());
sComm = new System.Data.SqlClient.SqlCommand("Select * from sys.databases WHERE name NOT IN ('master','model','msdb','tempdb')", sConn);
try
{
sConn.Open();
sReader = sComm.ExecuteReader();
Repeater1.DataSource = sReader;
Repeater1.DataBind();
sReader.Close();
}
catch (Exception ex)
{
// all other .NET exceptions
Labelerr.Text = ex.ToString();
}
catch
{
// all other exceptions
}
finally
{
if (sConn.State != ConnectionState.Closed)
{
sConn.Close();
}
}
//***************************************************************
Init();
//testDatabase_SelectedIndexChanged(DropDownList1, Nothing)
//****************************************************************
if (!(odbName==""));
{
Response.Write("odbName:" + odbName + " ");
odbName = Request.QueryString["db"].Trim(' ');
}
if (!(dbTableName == "")) ;
{
Response.Write("dbTableName:" + dbTableName + " ");
dbTableName = Request.QueryString["tableName"].Trim(' ');
}
string oMyString = null;
SqlDataReader odbreader = null;
SqlCommand odbcomm = null;
int oCounter = 0;
Session["connStringValue"] = "server=" + sDBServer + sDBServerProvider + ";uid=" + sUSERid + ";pwd=" + sDBPass;
oMyString = Session["connStringValue"] + ";Initial Catalog=" + odbName;
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(oMyString);
SqlConnection odbconn = new SqlConnection(builder.ConnectionString);
odbconn.Open();
DataTable tblDatabases = odbconn.GetSchema(SqlClientMetaDataCollectionNames.Tables);
odbconn.Close();
ArrayList oItems = new ArrayList();
ArrayList data = new ArrayList();
foreach (DataRow rowDatabase in tblDatabases.Rows)
{
if (!(string.IsNullOrEmpty(rowDatabase["table_name"].ToString())))
{
builder.InitialCatalog = rowDatabase["table_name"].ToString();
odbconn.ConnectionString = builder.ConnectionString;
oItems.Add(rowDatabase["table_name"].ToString());
//hs.Add("Inv#", "001");
data.Add(KV("Table:", rowDatabase["table_name"].ToString()));
}
oCounter += 1;
}
odbconn = new System.Data.SqlClient.SqlConnection(Session["connStringValue"].ToString());
if (odbconn.State != ConnectionState.Closed)
{
odbconn.Close();
}
//grid.DataSource = oItems;
//grid.DataBind();
repTest.DataSource = data;
repTest.DataBind();
//Session["oItems"] = oItems;
//Session["oCounter"] = oCounter;
//****************************************************************
}
// KV for KeyValue is defined as returning an anonymous object:
private object KV(string Key, string Value)
{
return new { Key, Value };
}
private static new void Init()
{
// initiate variables etc
}
protected override void OnInit(EventArgs e)
{
//MyBase.OnInit(e);
//Converted event handler wireups:
Load += Page_Load;
//AddHandler DropDownList1.SelectedIndexChanged, AddressOf testDatabase_SelectedIndexChanged
//AddHandler DropDownList1.SelectedIndexChanged, AddressOf DropDownList1_SelectedIndexChanged
//AddHandler grid.SelectedIndexChanged, AddressOf grid_SelectedIndexChanged
//AddHandler empDetails.PageIndexChanging, AddressOf empDetails_PageIndexChanging1
//AddHandler empDetails.ModeChanging, AddressOf empDetails_ModeChanging
//AddHandler empDetails.ItemUpdating, AddressOf empDetails_ItemUpdating
//AddHandler empDetails.ItemUpdated, AddressOf empDetails_ItemUpdated
}
public void BindGrid()
{
//***************************************************************
//***************************************************************
}
}
<%
//*************************************************
//cmsSchema.aspx Code Page
//*************************************************
%>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="cmsSchema.aspx.cs" Inherits="cmsSchema" %>
<!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>
<link rel="stylesheet" type="text/css" href="../css/outpost.css" />
</head>
<body style="background-image: url(../images/WebFront.jpg); background-repeat:repeat-x">
<!--START PAGE SECTION-->
<table id="table1" style="z-index:101; position:absolute; top:50px; left:5px; width:auto">
<tr>
<td>
<div style="width:900px; height:470px; font-size:smaller; overflow:auto; border: 0px solid #000000" id="DIV1" onclick="return DIV1_onclick()">
<form id="form1" runat="server">
Heading:1:#
<%
for (var i = 0; i <= 5; i++)
{
%>
<a href="cmsSchema.aspx?tablePage=<%=i%>">[<%=i%>]</a>
<%
}
%><a href="../Default.aspx">[Return]</a><br />
Heading:2:#Page:<asp:Label ID="LabelPage" runat="server"></asp:Label><br />
<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<a href="cmsSchema.aspx?db=<%# DataBinder.Eval(Container.DataItem, "name")%>">
<%# DataBinder.Eval(Container.DataItem, "name")%></a>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater><br />
Heading:3:#<br />
<asp:Repeater runat="server" ID="repTest">
<ItemTemplate>
<a href="cmsSchema.aspx?tableName=<%# DataBinder.Eval(Container.DataItem, "Value")%>">
<%# DataBinder.Eval(Container.DataItem, "Value")%></a>
<!--
<%#Eval("Key") %><br />
<%#Eval("Value") %>
-->
</ItemTemplate>
</asp:Repeater>
<div id="news" class="news" style="float:left;border:1px solid #CCC;padding:.5em;">
<h5 class="headline">Table Data</h5>
<asp:Label ID="Labelerr" runat="server"></asp:Label><br />
<asp:Label ID="detailsLabel" runat="server" />
</div>
</form>
</div>
</td>
</tr>
</table>
<!--END PAGE SECTION CODE-->
</body>
</html>
|
Advertisement
| Hall of Fame |