[英]How to remove ambiguous reference between two interfaces in same class in C# ASP.Net?
[英]the call is ambiguous between the same methods Asp.Net C#
我試圖在我的網站主題topic.aspx之一中編輯GridView。 我決定按照本教程從我在網格視圖中的設計視圖中放入的DataSourceID更改為自定義的DataSourceID。
我從register.aspx.cs頁面復制並粘貼了確切的SqlConnection,這是
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
作為topic.aspx.cs中的私有字段。
突然,我的注冊頁面不再起作用。 “ SqlConnection”中
new SqlConnection(...)
通話之間是“歧義”
SqlConnection.SqlConnection(string)
和
SqlConnection.SqlConnection(string)
我顯然毀了我所做的一切。 我的最后一招是完全刪除topic.aspx和topic.aspx.cs,但是...這樣行得通嗎? 我對此表示高度懷疑。
我不知道我做錯了什么,我只復制並粘貼了一行代碼,突然,我的register.aspx和login.aspx不再起作用。 問題是什么?
編輯:我正在使用的導入
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
如果您的連接字符串未使用Integrated Security = true ,則可以嘗試SqlConnection(String,SqlCredential)或僅調用默認構造函數
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.