将数据源从sql转换为access [英] converting datasource from sql to access

查看:57
本文介绍了将数据源从sql转换为access的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

愿大家安息....
我有一个简单的asp.net网站页面,该页面显示了如何使用ajax显示访问者评论.它使用sql server,但是由于许多原因,我想更改数据源,因此改用Access.我尝试了很多次,但是每次遇到错误时,我都会尝试.其中之一

((Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12031))


这是原始网站....
http://www.mediafire.com/?zyg2nxwynyu [

Peace be upon you all ....
i have a simple asp.net website page that show how to use ajax to display visitors comments. It uses sql server , but for many reasons i want to change the datasource so it uses Access instead. I tried that many times but every time i get errors. This one of them

((Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12031))


this the original website....
http://www.mediafire.com/?zyg2nxwynyu[^]
i need to add this code to my website ....

could any one help ?? :(( ;)

推荐答案

非常简单的代码,在这里是

<
it very very simple code, here it''s

<
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" DefaultMode="Insert">
<InsertItemTemplate>
Name: <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("name") %>'></asp:TextBox><br />
Comments:<br />
<asp:TextBox ID="txtComments" runat="server" Text='<%# Bind("comments") %>'

TextMode="MultiLine" Rows="4" Columns="50"></asp:TextBox><br />
<asp:HiddenField ID="hidTimeDate" runat="server" Value='<%# Bind("date") %>' />
<asp:Button ID="butSubmit" runat="server" CommandName="Insert" Text="Submit" />
</InsertItemTemplate>
</asp:FormView>
    <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"

        BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"

        CellPadding="3" CellSpacing="2" Width="806px">
        <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
        <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
        <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
    </asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"

        ConnectionString="<%


ConnectionStrings:CommentConnectionString %> ; " InsertCommand =" 插入用户(名称,评论,日期)VALUES(@名称,@评论,@日期)" SelectCommand =" 选择用户的名称,评论和日期" < InsertParameters > < asp:Parameter 名称 =" / < asp:Parameter 名称 =" / < asp:Parameter 名称 =" / < /InsertParameters > < /asp:SqlDataSource >
ConnectionStrings:CommentConnectionString %>" InsertCommand="INSERT users (name,comments,date) VALUES (@name, @comments, @date)" SelectCommand="SELECT name,comments,date FROM users"> <InsertParameters> <asp:Parameter Name="name" /> <asp:Parameter Name="comments" /> <asp:Parameter Name="date" /> </InsertParameters> </asp:SqlDataSource>


>

所以我想要用accessdata源替换sqldatasource,


>

so what i want is to replace sqldatasource with accessdata sourdce,


您是否具有打开Access数据库的必要权限?

您是否用Google搜索了要获取的异常代码?

如果您进行调试会怎样?它在哪里失败?

只需尝试几件事.
Do you have the requisite permissions to open the Access database?

Have you googled on the exception code you''re getting?

What happens if you debug? Where does it fail?

Just a few things to try.


这篇关于将数据源从sql转换为access的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆