Datalist没有出现EditItemTemplate |找不到网络路径 [英] Datalist not appearing EditItemTemplate | The network path was not found

查看:171
本文介绍了Datalist没有出现EditItemTemplate |找不到网络路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图在Datalist控件中显示EditItemTemplate,当我在我的电脑(本地)中运行时它的工作成功但是当我上传项目到主机并在配置文件页面中运行编辑按钮之后17-18秒显示错误未找到网络路径。这是错误错误记录,即时通讯等待你的帮助,非常感谢。

服务器错误  < span class =code-string>'  /'应用程序。 

找不到网络路径

描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪 有关错误的更多信息,其中源自代码中的关键字>。

异常详细信息:System.ComponentModel.Win32Exception:找不到网络路径

源错误:

执行期间生成了未处理的异常当前的网络请求。可以使用
下面的异常堆栈跟踪来识别有关异常的起源和位置的信息





 HTML记录

< / ProgressTemplate >
< / asp:UpdateProgress >


< / tr >

< / table >


< /编辑ItemTemplate >

< / asp:DataList >

< asp:HiddenField ID < span class =code-keyword> = UN runat = server / >

< asp:SqlDataSource runat = 服务器 ID = SqlDataSource2 ConnectionString =' <% $ ConnectionStrings:db_dogalinaConnectionString %> ' SelectCommand < span class =code-keyword> = SELECT * FROM [UserDetail] WHERE([UserName] = @UserName) >
< SelectParameters >
< asp:C ontrolParameter ControlID = UN PropertyName = DefaultValue = 名称 = 用户名 类型 = String > < / asp:ControlParameter >

< / SelectParameters >
< / asp:SqlDataSource >





代码背后CS 

protected void dataEditProfile_ItemCommand( object source,DataListCommandEventArgs e)
{
switch (e.CommandName)
{
case < span class =code-string> 编辑
{
dataEditProfile.EditItemIndex = e.Item.ItemIndex;
dataEditProfile.DataBind();


} break ;

case 更新
{`
BilgileriDoldur();
DL.Lib.ormDataContex ...`



  void 一些记录

私人 void BilgileriDoldur()
{
UserName = HttpContext.Current.User.Identity.Name;
DL.Lib.ormDataContext db = new Lib.ormDataContext();
SelectedUser = db.UserDetails.First(a = > a.UserName == UserName);
UN.Value = SelectedUser.UserName;


}



 Web.Config ConnectionStrings 

< connectionStrings >
< span class =code-keyword>< clear / >
< add name = dbConnectionString connectionString = Server = mssql。******。com;数据库= ******;用户ID = ******;密码= ****** providerName = 系统。 d ata.SqlClient / >
< add name = LocalSqlServer < span class =code-attribute> connectionString = Server = mssql。****** .COM;数据库= ******;用户ID = admindb;密码= ****** providerName = System.Data.SqlClient / >
< add name = db_dogalinaConnectionString connectionString = Server = mssql。******。com;数据库= ******;用户ID = ******;密码= ****** providerName = System.Data.SqlClient / > < / connectionStrings >

解决方案

ConnectionStrings:db_dogalinaConnectionString %> ' SelectCommand = SELECT * FROM [UserDetail] WHERE([UserName] = @UserName) >
< SelectParameters >
< asp:ControlParameter ControlID = UN PropertyName = 价值 DefaultValue = 名称 = 用户名 输入 = 字符串 > < / asp:C ontrolParameter >

< / SelectParameters >
< / asp:SqlDataSource >





 CS 

后面的代码 protected void dataEditProfile_ItemCommand( object source,DataListCommandEventArgs e)
{
switch ( e.CommandName)
{
case Edit
{
dataEditProfile.EditItemIndex = e.Item.ItemIndex;
dataEditProfile.DataBind();


} break ;

case 更新
{`
BilgileriDoldur();
DL.Lib.ormDataContex ...`



  void 一些记录

私人 void BilgileriDoldur()
{
UserName = HttpContext.Current.User.Identity.Name;
DL.Lib.ormDataContext db = new Lib.ormDataContext();
SelectedUser = db.UserDetails.First(a = > a.UserName == UserName);
UN.Value = SelectedUser.UserName;


}



 Web.Config ConnectionStrings 

< connectionStrings >
< span class =code-keyword>< clear / >
< add name = dbConnectionString connectionString = Server = mssql。******。com;数据库= ******;用户ID = ******;密码= ****** providerName = 系统。 d ata.SqlClient / >
< add name = LocalSqlServer < span class =code-attribute> connectionString = Server = mssql。****** .COM;数据库= ******;用户ID = admindb;密码= ****** providerName = System.Data.SqlClient / >
< add name = db_dogalinaConnectionString connectionString = Server = mssql。******。com;数据库= ******;用户ID = ******;密码= ****** providerName = System.Data.SqlClient / > < / connectionStrings >


什么从网络访问?似乎您的数据库连接丢失,请检查它是否真的有效

Hi,
I am trying to show EditItemTemplate in Datalist control, when i run in my pc (local) its working successfully but when i upload project to host and run edit button in profile page after 17-18 seconds its showing error "The network path was not found". Here is error error records, i m waiting for your helps, thanks so much.

Server Error in '/' Application.

The network path was not found

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Win32Exception: The network path was not found

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.



HTML Records

                        </ProgressTemplate>
                    </asp:UpdateProgress>


                                     </tr>

                                </table>


                    </EditItemTemplate>

                </asp:DataList>

                <asp:HiddenField ID="UN" runat="server" />

                <asp:SqlDataSource runat="server" ID="SqlDataSource2" ConnectionString='<%$ ConnectionStrings:db_dogalinaConnectionString %>' SelectCommand="SELECT * FROM [UserDetail] WHERE ([UserName] = @UserName)">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="UN" PropertyName="Value" DefaultValue="" Name="UserName" Type="String"></asp:ControlParameter>

                    </SelectParameters>
                </asp:SqlDataSource>



Code Behind CS

protected void dataEditProfile_ItemCommand(object source, DataListCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "Edit":
                {
                    dataEditProfile.EditItemIndex = e.Item.ItemIndex;
                    dataEditProfile.DataBind();


                }break;

            case "Update":
                {`
                    BilgileriDoldur();
                    DL.Lib.ormDataContex...`


void Some Record

private void BilgileriDoldur()
    {
        UserName = HttpContext.Current.User.Identity.Name;
        DL.Lib.ormDataContext db = new Lib.ormDataContext();
        SelectedUser = db.UserDetails.First(a => a.UserName == UserName);
        UN.Value = SelectedUser.UserName;


    }


Web.Config ConnectionStrings

<connectionStrings>
<clear/>
<add name="dbConnectionString" connectionString="Server=mssql.******.com; Database=******; User Id=******; Password=******" providerName="System.Data.SqlClient"/>
<add name="LocalSqlServer" connectionString="Server=mssql.******.com; Database=******; User Id=admindb; Password=******" providerName="System.Data.SqlClient"/>
<add name="db_dogalinaConnectionString" connectionString="Server=mssql.******.com; Database=******; User Id=******; Password=******" providerName="System.Data.SqlClient"/></connectionStrings>

解决方案

ConnectionStrings:db_dogalinaConnectionString %>' SelectCommand="SELECT * FROM [UserDetail] WHERE ([UserName] = @UserName)"> <SelectParameters> <asp:ControlParameter ControlID="UN" PropertyName="Value" DefaultValue="" Name="UserName" Type="String"></asp:ControlParameter> </SelectParameters> </asp:SqlDataSource>



Code Behind CS

protected void dataEditProfile_ItemCommand(object source, DataListCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "Edit":
                {
                    dataEditProfile.EditItemIndex = e.Item.ItemIndex;
                    dataEditProfile.DataBind();


                }break;

            case "Update":
                {`
                    BilgileriDoldur();
                    DL.Lib.ormDataContex...`


void Some Record

private void BilgileriDoldur()
    {
        UserName = HttpContext.Current.User.Identity.Name;
        DL.Lib.ormDataContext db = new Lib.ormDataContext();
        SelectedUser = db.UserDetails.First(a => a.UserName == UserName);
        UN.Value = SelectedUser.UserName;


    }


Web.Config ConnectionStrings

<connectionStrings>
<clear/>
<add name="dbConnectionString" connectionString="Server=mssql.******.com; Database=******; User Id=******; Password=******" providerName="System.Data.SqlClient"/>
<add name="LocalSqlServer" connectionString="Server=mssql.******.com; Database=******; User Id=admindb; Password=******" providerName="System.Data.SqlClient"/>
<add name="db_dogalinaConnectionString" connectionString="Server=mssql.******.com; Database=******; User Id=******; Password=******" providerName="System.Data.SqlClient"/></connectionStrings>


What are accessing from network ? it seems your database connection is go on lose, please check if it really work


这篇关于Datalist没有出现EditItemTemplate |找不到网络路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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