webform连接mysql,如何在C#ASP.NET webform中将数据库连接到bootstrap HTML表

Good day everyone i am working on a project on asp.net webform. i am using a template that has an already made table so i want to collect the table to the database so it can fetch out all the information and send it to the table. i wamnt the already made table to show everything on the database without creating from scratch

What I have tried:StringBuilder table = new StringBuilder();

protected void Page_Load(object sender, EventArgs e)

{

if(!Page.IsPostBack)

{

SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\odt\Documents\login.mdf;Integrated Security=True;Connect Timeout=30");

;

con.Open();

SqlCommand cmd = new SqlCommand();

cmd.CommandText = "select * from [log] ";

cmd.Connection = con;

SqlDataReader dt = cmd.ExecuteReader();

if (dt.HasRows)

{

if (dt.Read())

{

}

}

// cmd.ExecuteNonQuery();

con.Close();

}

this is the html table

IDUserPassword

解决方案

Your best bet, in ASP.NET (which is obsolete) is to use a repeater to build your bootstrap table out of a data source

包括源代码、数据库文档、数据库创建SQL脚本。一套基于ASP.NET MVC+EF6+Bootstrap开发出来的框架源代码! 采用主流框架,容易上手,简单易学,学习成本低。可完全实现二次开发、基本满足80%项目需求。 可以帮助解决.NET项目70%的重复工作,让开发更多关注业务逻辑。既能快速提高开发效率,帮助公司节省人力成本,同时又不失灵活性。 支持SQLServer、MySQL、Oracle、SQLite、Access 等多数据库类型。模块化设计,层次结构清晰。内置一系列企业信息管理的基础功能。 操作权限控制精密细致,对所有管理链接都进行权限验证,可控制到导航菜单、功能按钮。 数据权限(精细化数据权限控制,控制到行级,列级,单字段级,实现不同人看不同数据,不同人对同一个页面操作不同字段 兼容目前最流行浏览器(IE8+、Chrome、Firefox、360浏览器) 1、前端技术 JS框架:Bootstrap、JQuery CSS框架:Bootstrap v3.3.4(稳定是后台,UI方面根据需求自己升级改造吧)。 客户端验证:jQuery Validation Plugin。 在线编辑器:ckeditor、simditor 上传文件:Uploadify 数据格:jqGrid、Bootstrap Talbe 对话框:layer 页面布局:jquery.layout.js 图插件:echarts、highcharts 2、后端技术 核心框架:ASP.NET MVC5、WEB API 持久层框架:EntityFramework 定时计划任务:Quartz.Net组件 安全支持:过滤器、Sql注入、请求伪造 服务端验证:实体模型验证、自己封装Validator 缓存框架:微软自带Cache、Redis 日志管理:Log4net、登录日志、操作日志 工具类:NPOI、Newtonsoft.Json、验证码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值