sqlclient

Setup a valid connection string for SimpleMembership

a 夏天 提交于 2019-12-24 12:34:45
问题 I am trying to setup a valid connection string for my database so that my WebSecurity.InitializeDatabaseConnection method can point to my database. Here's my connection string: <add name="Database_Entities1" connectionString="metadata=res://*/Models.DAL.Entities.MTG_Model.csdl|res://*/Models.DAL.Entities.MTG_Model.ssdl|res://*/Models.DAL.Entities.MTG_Model.msl;provider=System.Data.SqlClient;provider connection string="data source=**.**.***.***;initial catalog=Model_Name;persist security info

Unable to find the requested .Net Framework Data Provider. It may not be installed. (System.Data.SQLClient)

左心房为你撑大大i 提交于 2019-12-23 19:18:33
问题 I tried to look at the data connection between my visual studio and SQL server, however it keeps on saying "Unable to find the requested .Net Framework Data Provider. It may not be installed." How can I get this fixed please? It was working before, suddenly it stopped working. I checked in the C:/windows/assembly System.Data.SQLClient is not there. 回答1: Ensure that the provider factory is registered with an appropriate entry in the machine.config. 回答2: In my case I was selecting the worng

Dataset column name and row value

倖福魔咒の 提交于 2019-12-23 12:55:54
问题 I have a data set: DataSet ds= _ExecuteQuery(contentCmd, CommandType.Text, contentParams); // Column name foreach (DataColumn column in ds.Tables[0].Columns) { Console.WriteLine(column.ColumnName); } // Rows value foreach (DataTable dt in ds.Tables){ foreach (DataRow dr in dt.Rows){ Console.Writeline(dr.Table.Rows[0]["name"].ToString()); } } How can I retrieve rows value and column name of the row? List<columnName, name>; 回答1: I assume that you're looking for something like this: Dictionary

A connection was successfully established with the server, but then an error occurred - provider: TCP Provider, error: 0

徘徊边缘 提交于 2019-12-23 12:42:59
问题 My web site was working flawless in the old Host , But now i Moved to a new host Please pay attention: The Old host was a VPS on the same host So i'v stoped paying him and now i'm hosting on the same host as a shared host . So I moved all the files in to the root folder and config the SQL details in the Web.config I can't load the site for some reason. i got Errors all the time. PLEASE HELP ME! After I Fixed my Ajax problem.. Here ->Could not load file or assembly 'System.Web.Extensions,

System.Data.IDbCommand and asynchronous execution?

…衆ロ難τιáo~ 提交于 2019-12-22 03:54:27
问题 System.Data.SqlClient.SqlCommand has methods BeginExecuteNonQuery BeginExecuteReader BeginExecuteXmlReader and EndExecuteNonQuery EndExecuteReader EndExecuteXmlReader for asynchronous execution. System.Data.IDbCommand only has ExecuteNonQuery ExecuteReader ExecuteXmlReader which are for synchronous operations only. Is there any interface for asynchronous operations ? In addition, why is there no BeginExecuteScalar ? 回答1: IDbCommand does not have the begin/end async methods because they did

Populate checkboxlist with items from database?

浪子不回头ぞ 提交于 2019-12-21 05:32:06
问题 Ok, so I want to populate/bind some data to a checkboxlist but cannot seem to binf the right values? I want to populate it with the information from a ROW, not the whole column which is what's happening to me. Here's some code anyways to show you what the problem is. This is the code in the xaml <form id="form1" runat="server"> <div> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [Option1], [Option2],

I can't connect to SQL Server database with C# code [closed]

耗尽温柔 提交于 2019-12-20 07:38:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . I was trying to create registration form but when I run my project am getting this error message Exception thrown: 'System.Data.SqlClient.SqlException' in System.Data.dll My code: using System; using System.Data; using System.Data.SqlClient; namespace Registration{ private void Register_Click(object sender,

System.IO.FileNotFoundException with SqlClient

时光总嘲笑我的痴心妄想 提交于 2019-12-19 16:56:10
问题 After fixing my problem as mentioned here I am getting the below exception System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.' My library is a .NET Standard 1.4 and the WebApp is .NET Framework 4.6.1 System.Data.SqlClient is version - 4.3.0 NuGet package. So I tried doing the below but in vain: <dependentAssembly>

Incorrect syntax near '<'. The label 'xmlns' has already been declared. Label names must be unique within a query batch or stored procedure

风格不统一 提交于 2019-12-12 23:50:56
问题 I am getting a string from a database that is in xml format and trying to update the xml with the following query: ExecuteNonQuery("Update Logs SET Message = " + encryptedMessage + " WHERE ID = " + message.Id); but it gives me the error message: Incorrect syntax near '<'. The label 'xmlns' has already been declared. Label names must be unique within a query batch or stored procedure. An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For

Very slow connection to SQL Server 2005 only if using ADO.NET with SqlClient

怎甘沉沦 提交于 2019-12-12 10:26:41
问题 I have a brand new server with Windows 2008 Server 64 bit + SQL Server 2005 Standard Edition SP3. When I try to open a connection to this server from a client in the same domain (Windows XP, .Net 3.5), it takes around 20 seconds to open the connection. After opening the connection, everything is fast as usual. When using a MDAC 2.8 connection, or ADO.NET OleDb, there is no problem at all. How can I find the reason for the slow connection? 回答1: The problem was the firewall running on the