想做新闻发布请大家给指条明路
数据库是access表名是news
只有四个字段id,strTitle,txtContent,dtIssue<table width="500" border="1" align="center">
<tr>
<td>新闻标题</td> //为里是表头
<td>发布日期</td>
</tr>
<tr>
<td>数据</td> //这里是要显示的数据
<td>数据</td>
</tr>
</table>
请问如下我要用什么来做?不用Datagrid可以实现吗?
我是想把信息输出来然后在标题生成超连链接传id的字段
------------------------------
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0";
strConnection += @"Data Source=C:\Inetpub\Myweb\yuze\database\test.mdb";
strSql = "select * from news";
OleDbConnection objConnection = new OleDbConnection(strConnection);
OleDbCommand objCommand = new OleDbCommand(strSql,objConnection);这么连接数据库可以吧?
数据库是access表名是news
只有四个字段id,strTitle,txtContent,dtIssue<table width="500" border="1" align="center">
<tr>
<td>新闻标题</td> //为里是表头
<td>发布日期</td>
</tr>
<tr>
<td>数据</td> //这里是要显示的数据
<td>数据</td>
</tr>
</table>
请问如下我要用什么来做?不用Datagrid可以实现吗?
我是想把信息输出来然后在标题生成超连链接传id的字段
------------------------------
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0";
strConnection += @"Data Source=C:\Inetpub\Myweb\yuze\database\test.mdb";
strSql = "select * from news";
OleDbConnection objConnection = new OleDbConnection(strConnection);
OleDbCommand objCommand = new OleDbCommand(strSql,objConnection);这么连接数据库可以吧?
解决方案 »
- html编辑器,也就是图文混排工具 。。。蛮好用,蛮漂亮
- 一个页面有多个gridview,怎样全部导出到excel
- 关于两组RadioButtonList 的选择 后回传
- input 控件问题?
- 一个小问题
- 怎样取得客户端一个固定路径下的文件的二进制流?
- 框架中scrolling的问题?
- quickly! 急! ASP.NET 为什么连不上远程数据库?
- (ASP高手)IIS5.1怎么样安装才能成功啊??
- 明天出差,要下周一才能来了,遗憾......放分......
- 正确的文件经常编译不通过,提示“字符无效”,是什么原因?
- 使用TableAdapter 时,与之相关的DataTable,DataSet,DataRow 之间倒底什么关系?
strConnection += @"Data Source=C:\Inetpub\Myweb\yuze\database\test.mdb";直接写成:
string strConnection = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Inetpub\Myweb\yuze\database\test.mdb";
设上排序表达式(实现标题生成超连链,点击排序功能)
2.连接数据库没测试,应该没错误
不要用沿袭asp那种思想,转换一下,找个简单的源码学学
<asp:repeater>
<itemtemplate>
<!--以下汉字部分你自己绑定就好了-->
<table width="500" border="1" align="center">
<tr>
<td>新闻标题</td> //为里是表头
<td>发布日期</td>
</tr>
<tr>
<td>数据</td> //这里是要显示的数据
<td>数据</td>
</tr>
</table>
</itemtemplate>
</asp:repeater>
不过我还是不明白
因为我不想去拖控件我是想手写代码
我感觉拖哪个好像页面就不太美观!而且html都已经做好了啊
我去查一下Repeater的资料
<%# DataBinder.Eval(Container.DataItem, "dtIssue") %>
输出的时间是2006-10-21 0:00:00
怎么让他只显示2006-10-21
这个没错 追加说一句。