SQL Server Query analyzer for B/S [provided by susue]

Source: Internet
Author: User
Tags sql server query

At the request of a friend susue, I want to publish a new version of susue ~ By the way, I hope you can give me some comments ~ Thank you ~ The running effect is as follows:

A. NET Framework is required

Superficial, with less than 50 lines of code

<% @ Import namespace = "system. Data" %>

<% @ Import namespace = "system. Data. sqlclient" %>

<SCRIPT runat = "server" Language = "C #">

String strconnection; // The string connecting to SQL Server

Sqlcommand objcommand; // SQL statement

Void btnselect_onclick (Object sender, eventargs E)

{

Strconnection = "Server = '" + tbxserver. text + "'; uid ='" + tbxuid. text + "'; Pwd ='" + tbxpwd. text + "'; database ='" + tbxdatabase. text + "'";

Sqlconnection objconnection = new sqlconnection (strconnection );

Objcommand = new sqlcommand (tbxsql. Text, objconnection );

Objconnection. open ();

Dgrdmain. datasource = objcommand. executereader ();

// Dgrdmain is the ID of the DataGrid below

Dgrdmain. databind ();

Objconnection. Close ();

}

</SCRIPT>

<HTML>

<Head>

<Title> B/s SQL Server Query analyzer by susue 2005-2-26 </title>

</Head>

<Body>

<Font color = "# dd0000" size = "5">

SQL Server Query Analyzer of B/S by susue 2005-2-26

<HR>

</Font>

<Form runat = "server">

<Asp: Label text = "Database Server:" id = "lbl1" width = "150" runat = "server"/>

<Asp: Label text = "User name:" id = "lbl2" width = "150" runat = "server"/>

<Asp: Label text = "Password:" id = "lbl3" width = "150" runat = "server"/>

<Asp: Label text = "Database Name:" id = "lbl4" runat = "server"/> <br>

<Asp: textbox text = "server" id = "tbxserver" runat = "server"/>

<Asp: textbox text = "uid" id = "tbxuid" runat = "server"/>

<Asp: textbox text = "PWD" id = "tbxpwd" runat = "server"/>

<Asp: textbox text = "Database" id = "tbxdatabase" runat = "server"/> <br>

<Asp: textbox text = "-- here you can enter an SQL statement, you can only execute one "id =" tbxsql "width =" 633px "rows =" 6 "textmode =" multiline "runat =" server "/> <br>

<Asp: button text = "Row query" onclick = "btnselect_onclick" id = "btnselect" width = "633" runat = "server"/> <br>

<Asp: DataGrid id = "dgrdmain" cellpadding = "1" showheader = "true" borderwidth = "1" runat = "server"/>

</Form>

<HR>

<Font color = "# dd0000" size = "5">

SQL Server Query Analyzer of B/S by susue 2005-2-26

</Font>

</Body>

</Html>

Http://www.chinaaspx.com/comm/dotnetbbs/Showtopic.aspx? Forum_id = 5 & id = 117612 & ppage = 1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.