aspx页面<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication2._Default" %><!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 runat="server">
<title>无标题页</title>
<style type="text/css">
.style1
{
border-style: none;
border-color: inherit;
border-width: 0px;
width: 100%;
margin: 0px;
height: 77px;
border: 0px;
}
</style>
</head>
<body style="margin: 0px">
<form id="form1" runat="server">
<div style="background-color: Green; height: auto; width: auto; visibility: collapse;">
<input id="Button1" type="button" value="button" /></div>
<div>
<table class="style1">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
.cs代码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;namespace WebApplication2
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
getBase(); }
}
private void getBase()
{
SqlConnection conn = new SqlConnection("server=.;database=northwind;uid=sa;pwd=sa");
try
{ conn.Open();
string sql = "select * from Employees";
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
da.Fill(ds);
Response.Write("<table>");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
Response.Write("<tr>");
for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
{
Response.Write("<td>");
Response.Write(ds.Tables[0].Rows[i][j].ToString());
Response.Write("</td>");
}
Response.Write("</tr>");
}
Response.Write("</table>");
}
catch (Exception)
{ throw;
}
finally
{
conn.Close();
}
}
}
}我想知道用JS如何实现对这个table数据的增删查改 - -太痛苦了 我需要看哪些技术知识
马上要做的项目就是纯html控件 包括数据绑定 等等 VS自带的不能用了
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
<style type="text/css">
.style1
{
border-style: none;
border-color: inherit;
border-width: 0px;
width: 100%;
margin: 0px;
height: 77px;
border: 0px;
}
</style>
</head>
<body style="margin: 0px">
<form id="form1" runat="server">
<div style="background-color: Green; height: auto; width: auto; visibility: collapse;">
<input id="Button1" type="button" value="button" /></div>
<div>
<table class="style1">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
.cs代码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;namespace WebApplication2
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
getBase(); }
}
private void getBase()
{
SqlConnection conn = new SqlConnection("server=.;database=northwind;uid=sa;pwd=sa");
try
{ conn.Open();
string sql = "select * from Employees";
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(sql, conn);
da.Fill(ds);
Response.Write("<table>");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
Response.Write("<tr>");
for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
{
Response.Write("<td>");
Response.Write(ds.Tables[0].Rows[i][j].ToString());
Response.Write("</td>");
}
Response.Write("</tr>");
}
Response.Write("</table>");
}
catch (Exception)
{ throw;
}
finally
{
conn.Close();
}
}
}
}我想知道用JS如何实现对这个table数据的增删查改 - -太痛苦了 我需要看哪些技术知识
马上要做的项目就是纯html控件 包括数据绑定 等等 VS自带的不能用了
解决方案 »
- 请教操作access数据库的语句问题。(oledbparameter)
- 这个论坛的网页左侧用的treeview控件导航,当点击结点时在同一个网页下右侧又添加了新网页怎么实现的?谢谢指教。。。。。急
- 怎样才是高手
- 求教关于ListBox下SelectedIndexChanged事件的问题(在线)
- 如何从订单表中获取支付所需参数?
- 大哥们好!请问谁有《ASP.NET Web站点高级编程:提出问题-设计方案-解决方案c#版》的电子书?谢谢
- 很郁闷~~~~~迟迟没有解决~~~~请高手帮忙看看
- sql @参数 的语法 怎么用
- treeview 的问题,我把webctrl_client 也搞上了,数据怎么还是没有树状效果,请各位指点。我有一个行的,但是其他目录就是不行,不知道怎
- ASP.NET的相关下载???给100分!!
- 关于iframe跳转主页的问题
- 同时出发两个链接?
纯HTML再用纯JS那开发速度得晕死。。可以学一下Jquery。下载一个Jquery文档。。或者买一本《锋利的Jquery》入门很好的书
学会把值post到后台 然后通过后台来处理