I've been using the new features with ASP.Net 2 for some months now. I use the gridview control a lot with the sqldatasource. I recently started a new job and am having problems connecting a sqldatasource control to a sql server 7 database. At my old job we used sql server 2000.
I get the error: "SQL server version needs be 2000 or higher" when I try to set up a new connection.. I read some documentation that said you can use asp.net 2 datasource controls with sql server 7. Does anyone know how to get round this issue. I don't want to have to go back to 1.x methods of connecting data controls to databases using code.
I used the Microsoft OLEDB provider for oracle from the dropdown,
The username and password I have also. I tried to enter in the Xtx20xxx as the server name, clicked "Properties"
put in the username and password I can given and clicked "Test Connection". No matter what I get the infamous ORA-12154: TNS:could not resolve service name error message. I am sure I am missing something obvious here but I have absolutely no clue and all the googling in the world has not given me any help. I do have the Oracle 10g client tools installed on this workstation (running Windows XP Prof SP2 and SQL 2005 STD).
Hi, I'm creating ASP that should run stored procedure on SQL server. I need to set up System DSN, right? When I logged on to the web server as some NT user (which is administrator for web server and has read permissions on the SQL server) - I successfully created the DSN. When I logged on to the server as Internet anonymous account (we use IIS 4.0, so it is IUSR_SERVER-NAME), I was not be able to set up the DSN, though I did the same as previously. This means that we don't have appropriate permissions for web server Internet anonymous, right? So question number 1: can it be set up read permissions on SQL server for local user from web server with the name IUSR_SERVER-NAME?
I now that a user can be set on SQL and I can use it's id while setting up the DSN (while doing this I need to choose "SQL Server Authentication" and provide user id and password, correct?). I tried this way as well -- when then I use the set DSN in ASP file I still have the "Not defined as a valid user of a trusted SQL Server connection" error in my browser. So question number 2: How to set up system DSN and provide in it SQL server's user id and password?
Or may be the problem is that I use stored procedure and need different type of permission?
I would appreciate if you aswer all the questions or give me explanation on the problem.
I have a server from a hosting company and they have so many databases on the server that it crashes my enterprise manager. So what I am looking for is a way to connect to only my database on that server. The tech support said to create a dsn and connect that way. Well i can do that with ms access, but I would prefer to use enterprise manager. Is there any way to set this up so all I get connected to is my database and not have to list all the databases on the server?
Any help with this would be great and if you can email me I would appreciate it.
I'm new to SQLExpress, and I need some help. I am trying to create a SQL database that will sit on a shared server in our organisation. I go into SSMSE and click on New Database which takes me to the New database screen. I now want to change the default path name to our server name, but when I click on the Locate Folder button (...), it only allows me to select folders from my Local drive. Is this a limitation of SQL Express, is there a way around this...?
I am developing a system using VS 2003 with database SQL Server 2000. In web.config, I have added the following code in it <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Database=grandb;Trusted_Connection=yes" cookieless="false" timeout="60" />
Actually I don't know if the above code is correct. My database is stored in the SQL Server 2000 and named as grandb. Thank you.
Hi, I am getting the following error when i am trying to connect to the database server installed on different box. "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)" When i searched google, some postings suggested to enable the TCP/IP and Named Pipes Protocols from SQL Server configuration Manager. I did so and also ran mofcomp command. But even after doing this i am not able to connect to the server. Following is my connection string. <add key="conn2" value="Data Source=xxxxxxxx;Initial Catalog=xxxxxx_xxxxxx;User ID=xx;Password=xxxxxx;"/> Could any one please tell me what else the configuration settings i need to do in order to connect to the database from my application.
I am having trouble connecting to my sql server database. I get the follwoing message when I tried to connected through a stored procedure
Insert Failed. Error Details are: System.Data.SqlClient.SqlException: Login failed for user 'merlin'. Reason: Not associated with a trusted SQL Server connection. at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) at System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) at System.Data.SqlClient.SqlConnection.Open() at ASP.insertvcds_aspx.AddJAV(Object sender, EventArgs e) in
I checked the merlin user and he is a user in the database with all priviledge granted to the database. What steps can I check to make sure in sql server enterprise manager to make sure it works.
I have been having problems lately in trying to connect my ASP.Net page to an SQL Server 2000 database. I downloaded and already installed the 120-trial of SQL Server 2000. I have already made a database for a project that I am working on.
**** Here is the code from the ASP.Net page that I created to test and see if I can connect to the database. ****
conPubs = New SqlConnection( "server=localhost;uid=;pwd=;database=TuneIn" ) conPubs.Open() End Sub
</Script>
Connection Opened!
**** Here is the error that I am getting. ****
Server Error in '/ASPnet' Application. --------------------------------------------------------------------------------
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. 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.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Source Error:
Line 9: Line 10: conPubs = New SqlConnection( "server=localhost;uid=;pwd=;database=TuneIn" ) Line 11: conPubs.Open() Line 12: End Sub Line 13:
[SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +484 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 ASP.connect_aspx.Page_Load() in C:InetpubwwwrootASPnetecommerceconnect.aspx:11 System.Web.Util.ArglessEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +10 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750
I hope this is not a dumb question, but how and where can I find out what the UserID (UID) and/or my Password is so I can connect my ASP.Net page to my database, because I do not ever remember putting a UID and/or a password when I installed SQL Server 2000???? In the ASP.net code above, I purposely did not put a UID and a password because I am not sure what to put there.... :-( ... Have I missed something somwhere?!?!?!?
Any help and or assistance will be greatly appreciated!! I have been trying for a week to figure out what is wrong, and I need help....PLEEEEEASE!!!
I am having a problem connecting with a database on my server.Please look at my following code: sub Page_Load(Sender as Object, e as EventArgs) dim myConnection As SqlConnection dim myCommand As SqlDataAdapter myConnection = New SqlConnection("server=XX.XXX.XX.XXX;database=Northwind;Trusted_Connection=Yes;userid=JoeSilla;password=XXXXXXX") myCommand = New SqlDataAdapter("SELECT * FROM Products", myConnection) Dim ds As DataSet = New DataSet() myCommand.Fill(ds, "Products") MyDataList.DataSource = ds.Tables("Products").DefaultView MyDataList.visible = true MyDataList.DataBind() end subPlease let me know if there is any problem with my code. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. 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.Data.SqlClient.SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:1. Add a "Debug=true" directive at the top of the file that generated the error. Example: <%@ Page Language="C#" Debug="true" %>or:2) Add the following section to the configuration file of your application:<configuration> <system.web> <compilation debug="true"/> </system.web></configuration>Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. Stack Trace:
[SqlException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) System.Data.SqlClient.SqlConnection.Open() System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) ASP.WebForm1_aspx.Page_Load(Object Sender, EventArgs e) in c:inetpubwwwrootday%208DataTestWebForm1.aspx:14 System.Web.UI.Control.OnLoad(EventArgs e) System.Web.UI.Control.LoadRecursive() System.Web.UI.Page.ProcessRequestMain()
I have a msaccess linked server that I use to execute sql 2000 stored procedures from a front end in adp (access data project) format without any problem, if it is used on the same machine where the sql server resides (with any user logged on). In any other machine on the local network where I also need to use it, I get an ole/db error message saying that the microsoft jet database engine can not open the file because it's allready opened exclusivly or because it do not has permissions. I created the linked server with both UNC and normal path with the same result.
i tried to connect to a SQL Server Compact Database (version 3.5) with SQL Server Management Studio Express (Version 9.00.3042.00).
But i get the follwing error message (sorry, it's a german message):
..................................... Es kann keine Verbindung mit 'D:DocumentsVisual Studio 2008Projects\_ProduktivSuperkalibrator_PrototypenSuperkalibrator_PrototypenDatenbankDatabaseTest.sdf' hergestellt werden.
Sie versuchen, auf eine ältere Version einer Datenbank von SQL Server Compact Edition zuzugreifen. Falls es sich um eine Datenbank von SQL Server CE 1.0 oder SQL Server CE 2.0 handelt, führen Sie 'upgrade.exe' aus. Falls es sich um eine Datenbank von SQL Server Compact Edition 3.0 oder höher handelt, führen Sie die Komprimierung und Reparatur aus. [ Db version = 3505053,Requested version = 3004180,File name = D:DocumentsVisual Studio 2008Projects\_ProduktivSuperkalibrator_PrototypenSuperkalibrator_PrototypenDatenbankDatabaseTest.sdf ] (SQL Server Compact Edition ADO.NET Data Provider) .....................................
Is there a solution to manage Compact Databases in Version 3.5?
hi all,my hosting company uses a different port for connect to their sql server.how do i register a server in sql server management studio with a different port number??
Newbie strikes again.. I'm attempting to connect to a SQL Server database (using VS 2005). My code generated no errors in the build but when I tried to access the database, I got the following message:"The ConnectionString property has not been initialized."My connection string is stored in my web.config file. My code goes as follows:Dim strSQL As String = "SQL string stored here"Dim objConnection as SqlConnection = New SQLConnection(ConfigurationManager.AppSettings("name of connection string is here"))Dim objCommand as SQLCommand = New SqlCommand(strSQL, objConnection)objConnection.Open()Then I go on to open my reader and such. Where should I be initializing the ConnectionString property?TIA,Lesley
I am interesting in knowing how to connect to database files that are not kept local to the SQL server? If you have any familiarity w/ this, can you please help me out w/ some information.
I am a new SQL Server developer using Visual Basic 6 Professional Edition. I am using ADO and SQLDMO to develop my application. The SQL Server is Version 7.0, SP2 and SP3 (two different servers).
I am having difficulty gaining access, using ADO, to databases I create using SQLDMO. I create the database, create the DBFILE object, create a login and attach it to the database, create a user, assign the created login to the user, and assign the created user to the 'db_datareader', 'db_datawriter' and 'public' roles. the login object was set to 'standard', not NT. the SQL Server is set to 'mixed' NT -SQL Server login mode. Thw SQL Server is running under the 'system account'. Using SQL Server Enterprise Manager, everything looks OK. An attemp to connect using the ADO connection object fails, giving an error of Login failed for user 'engbom3admin'.
Connecting to the SQL Server using SQLDMO uses the 'sa' user name with a blank password.
I can successfully connect to the created database using the ADO connection object using the 'sa' user name and blank password. Using the SQL Server Enterprise manager, I cannot see anything at all different between the 'sa' and my created 'engbom3admin' user. I've manually set the created user to have 'db_owner' roles, etc. Same result. I'm stumped. I've read all I can gather from the Microsoft SQL Server books. I'm still stumped.
I would greatly appreciate any help, information or tips you could provide. Thank you in advance.
Sincerely, Bob Wohlers SVP, IS Datamax Corporation
I created a database in SSMS,but I can't connect to it using VB Express code.When I delete the database name from the server I can connect to server,but when I mention the name of the database or initial catalog,I receive a login failure error for the mentioned database...
My connection string is:
Dim conn1 As SqlConnection = New SqlConnection("Data Source=.SQLEXPRESS;initial catalog=TEST1;" _
Everything is Local,I am using express version of SQL server and VB.How I am not be able to connect the database I created under the server in SSMS...I am really confused...
i have created a sql database in visual studio pro and now i would like to connect to that database in SQL server managamenet studio. so when i start SQL server i connect to the same instance as my database (wich is .SQLEXPRESS) but i can't find my database in the object explorer?
I've just installed a 365-day trail of microsoft SQL Server 5.0 Development edition and want to connect to a database in the database engine. I've checked that the services are running under My Computer->Manage->Services and Applications->SQL Server Configuration Manager and the SQL Server, SQL Server Agent msftesql and SQL Browser services are all running.
When I try to connect to my database, I get the following error:
InternalsVisibleTo declarations cannot have a version, culture, public key token, or processor architecture specified. (ObjectExplorer)
The start of this message is prefixed with: C:WINDOWSassemblyGAC_MSILMicrosoft.SqlServer.SmoEnum9.0.242.0_89845dcd8080cc91Microsoft.SqlServer.SmoEnum.dll
What on earth does all that mean? And how to I fix it so I can connect?
I am having a problem connecting to a database I have with a java app I am creating for my senior project. I am using the latest MS JDBC for connecting to the SQL Server.
con =ds.getConnection(); } catch (Exception ex) { ex.printStackTrace(); }
The ds and con variables are declared and initialized correctly. The error I am getting now is this: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "*databasename*" requested by the login. The login failed.
I've run into a bit of a database connection problem. I'm trying to connect to a SQL Server database. It compiles okay, but then while IE is loading, I get an exception error pointing out in the code saying 'Keyword not supported: 'provider'.
I have just put up an Webserver with SQL Server 2000. Everything is working fine on the remote machine Thru TS .. i can do every administrative things .. But i m facing problem to connect my remote databse server thru the Enterprise Manager .. It Gives me Cant Connect Database Server " Connection Failiure " when i try to connect my remote database server thru Ip address ,.. Please some one help me out to make connecting database server thru Enterprise Manager ..
Is this possible to connect do the Database Engine (on sql server 2005 on XP platorm - file *.mdf (not mobile *.sdf)) from win CE 5.0?
I tried to do this : ConnectionStringSQLServerCE = "Data Source=WORK_STATION\SQLEXPRESS;Initial Catalog=dbMachines;Integrated Security=False;Password=Panel;User ID=Panel";
SqlCeConnectionCE = new SqlConnection(ConnectionStringSQLServerCE);
SqlCeConnectionCE.Open();
but I catch error: catch (PlatformNotSupportedException ex) €žPlatformNotSupportedException€? I noticed that I see server because when I use: ConnectionStringSQLServerCE = "Data Source=WORK_STATION\SQLEXPRESS";
zwraca błąd typu
catch (SqlException ex) €œLogin failed for user ''. The user is not associated with a trusted SQL Server connection.€?
I used using System.Data.SqlClient;
from Compact Framework 2.0 under Visual Studio 2005 Device Application Windows CE 5.0
I am having problems connecting to the database. I am trying to use Membership API and for some reason it will no longer connect to the database. I previously had Visual Studio 2005 Standard Edition and it worked just fine, until I tried to install MS SQL Express. I have tried the aspnet_regsql and sqlcmd InstallCommon.sql and both times I received a named pipe error. I look at the configuration and it said named pipes enabled.
I eventually gave up after trying for two days and removed MS SQL Express, but now I am still getting the same error. I tried to uninstall all of the SQL editions and reinstall the MSDE that comes with VS 2005, but I am getting the same error.
When checking the ASP.NET Web Application and testing the provider I receive the following error: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
The security tab gives you the following error: There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem: Unable to connect to SQL Server database.
Running the sqlcmd in the command prompt I receive the following error: Sqlcmd: Error: Connection failure. SQL Native Client is not installed correctly. To correct this, run SQL Server Setup.
I want to use SQL Server to query an Access Database with about 40,000 rows of data. If possible, I don't want to upsize the database because others need acess to it in the ACC97 format. Is there a way to use ODBC to connect to the ACC97 database so that I can use the SQL query capability of SQL server to query the database.
I know access allows you to write some SQL queries but I need the power of the SQL server and now it is a matter of curiosity because I've been searching for this answer for about 8 hours.
I have a very basic console application whose sole purpose is to query a database on the same local computer. When i run the application, i get the error message below: Cannot open user default database. Login failed.Login failed for user 'someDomainSomeUserName'. Below is my connection string also myconnection_string = New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=C:Reporting SystemApp_Datasafetydata.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"). After some googling, some post pointed to deleting a user folder at : C:Documents and SettingsmyusernameLocal SettingsApplication DataMicrosoftMicrosoft SQL Server DataSQLEXPRESS but still deleting that folder and restarting the machine doesn't help and i also have remote connections enabled. Help is really needed. NOTE: The same application runs on a different computer with XP but fails on the Pc with windows server 2003.
I've had some problems with Reporting Services and getting connected to the database server after configuration. I am now getting the following error message:
The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing. (rsReportServerDatabaseUnavailable) (rsRPCError)
In my Database Setup everything runs fine when I click apply except for the Setting Connection Info for Reporting Server this has a yellow triangle with a ! and says that the report server cannot access internal information.
I also have not been able to Initialize as there are no instances to initialize and none are created when I go through setup. Is there something I need to delete from the registry or the file system that does not get removed upon uninstall?
I've tried everything. The CreateUserWizard works fine, but then, I didn't have to connect anything for that. I've tried both SQLServer and MySQL. Connection Strings are correct, everything is correct as far as I can see. I've followed every step many many times. I'm about to go back to the old style and use VB6, because this is just stupid. The error I get is "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)" If anyone could help me out with this I'd really appreciate it.
I have a proprietary OLEDB data source that works alongside a SQL database. Both are pretty big. I am trying to find a fast way of copying the data from the OLE source into a table in the SQL database. I am working in ASP.NET, and the easiest way is to have 2 connections, open the OLEDB and fill a datatable, then go through the table line by line and do a parametized insert. That works but takes far too long.
I am looking for something along the lines of "SELECT INTO tblB FROM tblA", or even "INSERT INTO tblB SELECT * FROM tblA", anything that is faster than the above. Can you do this in SQL but accessing an OLEDB datasource?
Hi I am trying to open a database connection to a Northwind database. I can open it with a datasource control and return data to a gridview, but can't programically. I get a sqlexception error. this is ust for learning. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim S As New SqlConnection Dim builder As New SqlConnectionStringBuilder builder("Data Source") = ".SQLEXPRESS;AttachDbFilename=C:SQLNORTHWND.MDF" builder("Integrated Security") = True builder("Connect Timeout") = 30 builder("User Instance") = True S.ConnectionString = builder.ConnectionString Me.Label1.Text = S.ConnectionString S.Open() Me.Label2.Text = S.State.ToString S.Close() Me.Label3.Text = Me.SqlDataSource1.ConnectionString.ToString End Sub The text in label2 and Label three are identical except there are "" around the datasource. How come I can connect through the datasource control but not through code?
I have a VS 2005 Web Appplication solution that uses SQL Server Reporting Services 2005. One of the projects is a Report Server Project. In this project I have an RDL file that has: 1.)a non-shared XML DataSource (no credentials), 2.)a DataSet with a Command Type of Text and a Query String that is as follows: <Query> <XmlData> <Root> <LOAD LOAD_ID_PREFIX="" LOAD_ID="" TRUCK="" DIAGRAM=""/> </Root> </XmlData> </Query>
3.)a field that comes from the Database that is of VarBinary(Max) that is a JPEG Image
What happens is, is that by doing #2 above, at design time I can create tables and hook into my datasets and get the report all designed out the way I want. Then at runtime, I have a Stored Procedure that uses the "FOR XML AUTO" option so that I can represent my results from the database in an XML fashion which will allow me to replace the XML Schema in between the Root tags above (in #2) with my actual data (which still has the same schema). I then save the modified RDL to a database table field and move on to happily ever after......in this case, not. In this case, since an VarBinary is involved, unless I want to get a pointer back for the Diagram Column, I have to use the "FOR XML AUTO, BINARY BASE64" option. This returns an Encoded string to represent the Binary value that was in the Database....and this is the partial source of my angst....read on.
My approach that I described above worked flawlessly in all cases where an image wasn't involved. This report is the only report in the whole system I am working on that will have an image and it is the last one being done, so that's why I didn't run into this earlier.
I have tried all kinds of things at different levels, but the thing that I have tried that seemed to me to have the most potential was to use Embedded Code to take the Encoded ASCII Value and convert into something binary that the SSRS Reporting Engine likes (so my image will show), but I have been unsuccessful thus far. The error message I keep getting now from my Embedded Function is: "Invalid length for a Base-64 char array", which I have not been able to resolve thus far....and I do know that the Binary value in the database is good becuase I can see it in pages in my application otherwise.
This aside, is there anyone out there that knows how to take the value of a VarBinary(Max) field and insert it into the Text (XML) DataSet in the markup of an RDL file....and have it appear correctly when the report is rendered in something like the standard Report Viewer Control (or even when being previewed at design time inside of Visual Studio for that matter)?
Just to be clear, the root of my problem, as I see and understand it, is that I have a VarBinary value in a database that is being converted to a string (ASCII...I am presuming) due to how I am writing my stored procedure and then needs to go back to something else binary that the SSRS Engine will accept so that I can see my Image in the report when I render it.
I am wishful that someone out there understands my problem and has run into this and has a solution......but I am wishful of winning the lottery, too, and that hasn't happened yet...............