Simple Question (connect To Database)
May 13, 2008
How can I connect to another sqlserver instances using a SQL Query Analyzer command? I mean, something like this:
connect (server1.instance1, user, pass) ??
SELECT * FROM MYTABLE;
connect (server1.instance2, user, pass) ??
SELECT * FROM MYTABLE;
connect (server1.instance3, user, pass) ??
SELECT * FROM MYTABLE;
PD: I know I can click in File-->Connect-->etc..., but I want to do this with a T-SQL command
View 5 Replies
ADVERTISEMENT
May 13, 2008
How can I connect to another sqlserver instances using a SQL Query Analyzer command? I mean, something like this:
connect (server1.instance1, user, pass) ??
SELECT * FROM MYTABLE;
connect (server1.instance2, user, pass) ??
SELECT * FROM MYTABLE;
connect (server1.instance3, user, pass) ??
SELECT * FROM MYTABLE;
PD: I know I can click in File-->Connect-->etc..., but I want to do this with a T-SQL command
View 7 Replies
View Related
May 17, 2006
I have searched for what I think is a simple solution.
In my aspx.vb code page, I need to make a connection to SQL Server (my connection strings are in the web.config file) and then make a simple SQL Select to return one or 2 values.
For example, the user will select a customer on the ASP form, then I need to read a couple of default values from that user's record and display them back onto the form.
Can someone provide the sample code or direct me to this? I'm thinking that this is rather simple, but I can't seem to make it work. If I see a sample of exactly what I need to do, such as reading a value using the Northwind sample DB, then I can modify it to fit my table structure, etc.
Thank you.
View 3 Replies
View Related
Jul 20, 2005
Anyone support a config where you have an unix/linux (AIX here) ODBCclient connection to SQL Server database? I am looking for a simple,supportable configuration that does not require me to learn perl orinstal a bunch of crap gnu shareware on enterprise class machines.Please help!
View 3 Replies
View Related
Aug 16, 2007
Hi All,Can u please suggest me some books for relational database design ordatabase modelling(Knowledgeable yet simple) i.e. from which we couldlearn database relationships(one to many,many to oneetc.....),building ER diagrams,proper usage of ER diagrams in ourdatabase(Primary key foreign key relations),designing smallmodules,relating tables and everything that relates about databasedesign....Coz I think database design is the crucial part of databaseand we must know the design part very first before starting up withdatabases.....Thanks and very grateful to all of you....Vikas
View 3 Replies
View Related
Aug 26, 2007
I've looked over the "how do I" stuff but not found a simple, straightforward to simply make a complete snapshot of a relatively small development database (perhaps 2 to 3 meg at this point) so that I can bring it to my local system (from a hosting provider) or vice-versa.
I see the info on "SQL Server Import and Export Wizard" but I don't find the functionality in SQL Server Management Studio Express -- or am I missing it?
Such a process seems obvious. It's not "replication" is it? I don't need it on an on-going basis -- just an occasional one-time thing.
Mahalos (thanks) in advance for any guidance ... :) KevInKauai
View 5 Replies
View Related
Jan 31, 2006
Hi,
I am writing a simple program which runs on users xp machines and accesses a simple table on an NT Server.
In otherwords, the database consists of just a single table with perhaps 4 fields and a maximum of 200 records, with low transaction activity (users periodically update their status or check on other users' statuses).
Do I need to use SQL????
What is my best option for such a simple table / database.
Your help would be appreciated.
View 6 Replies
View Related
May 23, 2007
I thought I would start learning how to backup my SQL Server 2005 database using the simple recovery method. Using the SQL Server Management Studio I started the backup task. In the Back Up Database dialog box the Recovery Model is set to Full and disabled (grayed out). It does not give me the option to switch to the Simple Recovery Model. Is there a setting I need to adjust that will allow me to switch to the Simple Recover Model?
View 4 Replies
View Related
Oct 9, 2006
I have an application that creates a new database during installation,and I've noticed some strange behavior. Once I've created thedatabase, I am able to immediately create tables and populate lookupdata, provided I remain connected to the server. If, however, Idisconnect and attempt to reconnect immediately, I'll get an errorsaying that my login is invalid for the new database.I can get around this by having my code simply wait 5 seconds beforeattempting to reconnect, but I'm curious to see if anybody here cangive an explaination for why this is happening. Here is a bit ofpseudo code to explain what I'm seeing:open new connectioncreate databasecreate tablespopulate tablesclose connection// open new connection /* can't do this yet, as it would break */for (int a=0; a<5; a++){Thread.Sleep(2000)try{open new connectionbreak;}catch{Debug("still waiting...");}}Running my version of this code, I'll see that "still waiting..."message go past 2-3 times before SQL Server wakes up and realizes thatI'm allowed to connect to it. Anybody know why?Thanks,Jason KesterExpat Software Consulting Serviceshttp://www.expatsoftware.com/---Get your own Travel Blog, with itinerary maps and photos!http://www.blogabond.com/
View 1 Replies
View Related
Dec 7, 2004
Hello,
I have a search form in an ASP.NET/VB page. The form has the input text box and the button "search". The keywords are passed in the URL to results.aspx.
Here is an example of what I get in the URL, when I write the keywords "asp", "book" and "london" in the input text box and click "search":
results.aspx?search=asp%20book%20london
The database table has 3 fields: "id", "title" and "description".
I want to display all the records where at least one of the keywords is found in any of the 2 fields "title" and "description".
1. I suppose I need to get the words out of the URL to be used by SQL.
Maybe: string[] searchString = request.queryString("search").split('search'); ???
How can i make this run when page loads? I supose i need it. Right?
2. How should the SQL look? I supose i need to use the "Like" command
SELECT * FROM books WHERE title LIKE ...
But how to I use it if I can have 1, 2, 3, ... keywords?
Can someone help me?
Thanks,
Miguel
View 1 Replies
View Related
Aug 8, 2007
Hi- I have questions about mobile database limits. The application is entirely C# / Compact Framework 2.0, using VS2005. Devices we support are all running WM5. We're trying to incorporate what seems to be a large database that the application needs to talk to offline from any network, so it needs to be stored & hosted within the database and hence we started working with the various generations of what is now SQL Server Compact Edition.
In order to profile the responsiveness I worked up a test database with the general collection of fields we are interested in. The main table has 80,000 rows with one primary key and one of the numeric fields indexed. There is a 'nickname' table which contains about 150,000 items with just a string for a nickname and the key that nickname goes with. With all the rows and an alpha index for the nickname field the database is about 42 mb. Which is pushing the amount of storage on the handheld, but of our two models one is fine and one still has about 30 mb free with the DB on the handheld.
My problem seems to be that one kind of device can work with this database and one cannot. The device I was using the prototype the application is a HP iPAC hx2490b. On that device more than once I have corrupted the database, but not yet as a reproducible process.
My other device is a Dell Axim X51. On that device I seem to corrupt the database with very simple actions. Just now I tried a query like (From the Query Analyzer 3.0)
Code Snippet
Select * from ReagentNicknamesTable where alt_names like 'alpha%'
Which should hit 2099 of the 150,000 records. I got about 400 back and then the table was corrupted. On this device I cannot recover the database as there isn't enough disk space for two copies of the DB. So corruption in the field would be a showstopper. But getting corruption from a simple query like this means I really can't use SSCE.
This problem with the dell showed up when I was using the original device sql that came with VS2005. (SQL Server Mobile?) The cabs & dll's were dated from 2005 and had a build number of 3.0.5206.0. I have since updated to the current version of SQL Server Compact Edition and the dlls have build number 3.0.5300.0. The IDE is set to Compact Framwork 2.0, sp1: cgacutil reports CF 2.0.6129.0.
So help! Have I hit some listed or unlisted limits to SSCE on the Compact Framework? thanks.
View 6 Replies
View Related
Apr 24, 2008
Hi,
I tried to create a simple application based on the Sql Server CE samples and, as is typical when I play with databases, the program failed. In this case it failed to even load. The program has a form and a data source that I dropped onto the form. When I run the program the program breaks at this line:
Code Snippetthis._connection = new global::System.Data.SqlServerCe.SqlCeConnection();
The error is:
An unhandled exception of type 'System.DllNotFoundException' occurred in System.Data.SqlServerCe.dll
Additional information: Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
My first attempt at 'fixing' this was simply to copy the requisite DLLs to my bindebug folder. I found the DLLs here:
C:Program Files (x86)Microsoft SQL Server Compact Editionv3.5 and copied these - sqlcecompact35.dll, sqlceca35.dll, sqlceme35.dll, sqlceoledb35.dll, sqlceqp35.dll and sqlcese35.dll, sqlceer35EN.dll - to my bindebug folder.
Now instead of the first error, I get this error:
An unhandled exception of type 'System.BadImageFormatException' occurred in System.Data.SqlServerCe.dll
Additional information: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
I am running Vista Business (x64) and using (the desktop version of) Sql Server Compact Edition 3.5 with Visual Studio 2008 Standard Edition. The test 'program' is written in C#. (Incidentally I can play with the database with no problems in Visual Studio 2008's server explorer. I can look at data, add data, etc.)
Can anyone please help?
Thanks.
View 3 Replies
View Related
Oct 30, 2007
Hi all,
I am a sysadmin (not a DBA by any means!), so just keep that in mind when answering
I was thinking to set up a database mirror with a manual failover for my Business Objects server. The question I have here, is the database name.. how is it kept?
I have three servers right now, all pointing to the same database. Let's call it DatabaseA. If I set up database mirroring (the links I've seen make it seem simple enough), and I fail over, what happens to the servers that have an ODBC entry to DatabaseA? Do I have to repoint them? Or is the identity of the server transferred over as well?
A little information on this would be greatly appreciated. Right now, we are using doubletake to copy over the database dumps on a constant basis, and I thought that database mirroring would be a better solution to my problem. Please let me know! I am quite new to database mirroring, so take it easy with me
View 4 Replies
View Related
Oct 22, 2007
Hi,
I am beginner developer, Creating simple application which will create, handle small database of genral store products (like adding products and substracting no. of products) . I am creating application with native win32 APIs in VS 2005.
Please suggest , how to create such data base , and suggest me link where i will get step by step knowledge to do (learn) it.
Do i need to learn ODBC or OLEDB or SQL server
Thanks
View 4 Replies
View Related
Jan 18, 2008
I'm designing a database with 3 tables called Function, Test and Scene.
A Function has multiple Tests, but a Test has only one Function. A many to many relationship exists between Test and Scene therefore I need a junction table between these two tables - giving 4 tables in total. The Test table would store a foreign key, the primary key of the Function table.
There is a problem with design though and that is that Functions and Scenes are actually defined before the Test is defined. Therefore it should be possible to create a Function and add to id its Scenes, before Tests have been defined. In other words, Scenes are as much a part of a Function as they are of Tests. Tests are in fact only of relavence to testers. Anyway, to satisfy this scenario, a Junction box is also needed beween Function and Scene. This creates a loop between all tables.
Is this a good approach? Any other suggestions or advice on the matter? Any advice regarding data integrity?
Thanks,
Barry
View 1 Replies
View Related
Nov 30, 2006
Hello,
How do you copy all stored procedures into a .sql file using Microsoft SQL server management studio?I am trying to make a database installation file that should have all the tables and SP in it, can't find away to copy that information to a .sql file.
Patrick
View 1 Replies
View Related
Mar 10, 2008
This is a part of my project and that are my first steps. I just want to know if there is a user with "username" already in the database. The MSDN Documentation says that the ExecuteNonQuery() Method returns the number of affected rows. But if I run this code I always get x=-1. What does that mean ?
using (SqlConnection sqlcon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["web_db_1"].ConnectionString)) { SqlCommand cmd = new SqlCommand("Select user_id From users Where username = '" + username + "'", sqlcon); cmd.CommandType = CommandType.Text; cmd.Connection.Open(); int x = cmd.ExecuteNonQuery(); cmd.Connection.Close(); }
Thanks,
Party-Pansen
View 5 Replies
View Related
Jan 4, 2008
Hi everyone,
BACKGROUND:
I just set up a network with 2 computers (direct cable network, no routers/hubs), one computer is running Windows 2000 Server and the other is running Windows XP Professional. They both recognize each other and I can access each computer on either computer. The WinXP computer has SQL Server 2005 express edition installed on it.
BASIC PROBLEM:
I am trying to install a database server on my Windows 2000 Server OS computer. This computer is a 350MHz, 256mb RAM computer. How would I go about doing this?
Thanks.
View 11 Replies
View Related
Oct 10, 2005
Hi ,I have set up my database to be using "Simple" mode. This will not log anytxns ?I have got the err message saying the log file is full and i need to do atxn log backupi do not understand why , could anyone kindly advise ?tks & rdgs--Message posted via SQLMonster.comhttp://www.sqlmonster.com/Uwe/Forum...eneral/200510/1
View 1 Replies
View Related
Jul 20, 2005
Hi ng,I need some input/suggestions for a very small layout.The situation: Some groupings of thumbnails. For every picture (thumbnail)there is a "big" picture. Thats it basically :) On the front the scenario isthis:A user clicks "Autumn". The user is presented with the "Autumn" thumbnails.If he click a thumbnail, the corresponding big image is displayed. Well, uget the picture :)Hoe is this most efficiently implemented in table-layout? I mean....do Icreate a table called "images" and have a column called "is_thumb"? Or do Ibetter make 2 tables...Or better make a "relation/type" table too?--?Thanks,/Summa
View 4 Replies
View Related
Jun 14, 2006
I was able to connect to the SQL Database Pension with table clients with table values: ID, State, Name.'Create(connection)Dim conn As New Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)'open connectionconn.Open()However, I'm not sure how to insert a new row with an incremental ID number and a new State and Name.Sorry, I'm really new with VWD.
View 1 Replies
View Related
Jul 16, 2006
Database not found !
My web.config file has this bit of code:
<connectionStrings>
<add name="AppConnectionString1" connectionString="Data Source=".SQLEXPRESS";AttachDbFilename="C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataAdventureWorks_Data.mdf";Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
But........................... the is no "AdventureWorks_Data.mdf" in that folder ?
And the database is installed in the right place !
help !
View 6 Replies
View Related
Nov 2, 2007
Hi,
I am designing a site using Visual Web Developer, CSharp and Sql server Express.
One the contact page I want to put a form that allows users to enter details about
themselves. On clicking the button this will be stored in the database under a table
called subscribers. The form will have, name, address, telephone, email fields etc.
With the email addresses from the visitors I want to be able to keep them in
a newsletter section or similar which is automated so they recevie emails from time to time
Could somebody suggest a tutorial which shows how to complete this process
using c sharp and sql.
Thanks for you time
Prontonet
View 2 Replies
View Related
Oct 6, 2006
Following update runs 20 hours till TEMPDB grows up to 400GB and runs out of space with error message:
Msg 1105, Level 17, State 2, Line 8
Could not allocate space for object 'dbo.Large Object Storage System object: 440701391536128' in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
T_PERF_LOC has 30,000,000 rows and T_MASTER_LOC has 2,000,000 rows
There is and index on V_KEY in both tables. CHANNEL_KEY is of Integer datatype and not indexed.
F_MAP function performs simple lookup on very small table (10 rows)
UPDATE A
SET CHANNEL_KEY = OTHERDB.DBO.F_MAP(b.ID)
FROM T_PERF A
JOIN dbo.T_MASTER b
on a.V_KEY = b.V_KEY
Any ideas why?
Thanks
View 4 Replies
View Related
Nov 3, 2015
Have a database that's in "Simple" recovery mode whose .ldf has grown to 270GB. This database is a data warehouse so "full" is not required. I put it in simple mode a month ago and shrunk the log down and now it's filled up the disk.
What steps can I take to mitigate this in future? I've read that this is caused by long running transactions which fill the log for DR purposes. Should I put the database back into full mode and backup/truncate daily.
The auto-growth is set to 128MB which is very low.
View 3 Replies
View Related
Jun 8, 2006
I have been trying to export an sql2000 database to sql2005 with no luck. I continuosly get the error
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
I have looked upon all support material and have installed the latest sql2005 service pack, but this has not fixed the problem. a simple query as:
select * from [transaction] ta,transactionentry tr
where tr.transactionnumber=ta.transactionnumber and
glacctid=6 and ta.[time]> '3/01/2006'
would produce this fatal error.
the current version I am using is:
Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)
This problem is happening on some of the most important tables in the database.
the error log contains the following:
2006-06-06 11:43:32.59 spid54 ***Stack Dump being sent to C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGSQLDump0001.txt
2006-06-06 11:43:32.59 spid54 SqlDumpExceptionHandler: Process 54 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
2006-06-06 11:43:32.59 spid54 * *******************************************************************************
2006-06-06 11:43:32.59 spid54 *
2006-06-06 11:43:32.59 spid54 * BEGIN STACK DUMP:
2006-06-06 11:43:32.59 spid54 * 06/06/06 11:43:32 spid 54
2006-06-06 11:43:32.59 spid54 *
2006-06-06 11:43:32.59 spid54 *
2006-06-06 11:43:32.59 spid54 * Exception Address = 0136B4F0 Module(sqlservr+0036B4F0)
2006-06-06 11:43:32.59 spid54 * Exception Code = c0000005 EXCEPTION_ACCESS_VIOLATION
2006-06-06 11:43:32.59 spid54 * Access Violation occurred writing address FFFFFFFC
2006-06-06 11:43:32.59 spid54 * Input Buffer 260 bytes -
2006-06-06 11:43:32.59 spid54 * select * from [transaction] tr,transactionentry te where tr.
2006-06-06 11:43:32.59 spid54 * transactionnumber = te.transactionnumber and glacctid = 6
2006-06-06 11:43:32.59 spid54 *
2006-06-06 11:43:32.59 spid54 *
2006-06-06 11:43:32.59 spid54 * MODULE BASE END SIZE
2006-06-06 11:43:32.59 spid54 * sqlservr 01000000 02BA7FFF 01ba8000
2006-06-06 11:43:32.59 spid54 * ntdll 7C800000 7C8BFFFF 000c0000
2006-06-06 11:43:32.59 spid54 * kernel32 77E40000 77F41FFF 00102000
2006-06-06 11:43:32.59 spid54 * MSVCR80 78130000 781CAFFF 0009b000
2006-06-06 11:43:32.59 spid54 * msvcrt 77BA0000 77BF9FFF 0005a000
I have followed instructions on some support issues posted but none have helped. If anyone has any solution to this problem PLEASE HELP!!!!.
Thanks.
View 7 Replies
View Related
May 26, 2004
Hey,
I have MS SQL database.
I have procedure:
code:--------------------------------------------------------------------------------
CREATE PROCEDURE dbo.Reg_DropTable
@ModuleId varchar(10)
AS
declare @TableName varchar, @kiek numeric
set @TableName = 'reg_'+@ModuleId
begin
DROP TABLE @TableName <- HERE I GOT ERROR
end
GO
--------------------------------------------------------------------------------
I got error when using variable with tables names.
How to do this?
Ps. Number is send to this function and it must drop table with name Reg_[That number]
View 1 Replies
View Related
Mar 6, 2015
One of my programmers changed their database from full to Simple recovery. Saw that my job that backs up the Full Recovery mode databases failed, so I moved that database to my Simple database backup job plan and removed it from the Full Recovery job. I am unable to remove the db from the Transaction Log task on the Full Plan because when I try to edit that job "Databases with Simple Recovery will be excluded"
My transaction log backups are still failing with the following error: "The statement BACKUP LOG is not allowed while the recovery model is SIMPLE. Use BACKUP DATABASE or change the recovery model using ALTER DATABASE. BACKUP LOG is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.Just want to remove that database so my Full Recovery backup job does not try to back it up.
View 2 Replies
View Related
Jul 27, 2015
I have a database that I am trying to recover space from, it consists mostly of unallocated space, but I can’t seem to get that unused space released.
Database size: 40,245.13 MB
DatafileMB: 38,063.63, DataAvailableMB: 37,085.15
LogfileMB: 2181.51
Sysfiles shows:
fileidgroupidsizemaxsizegrowthstatusperfname
114872144-112820SomeDB
202792332684354561010486420SomeDB_log
The DB is in simple recovery mode. There are no open transactions (used dbcc opentran).
The server is running SQL Server 2014 and the DB is in compatibility mode SQL Server 2008 (100). It was upgraded to 2014 a month or two ago.
I have tried to re-size the log to 100mb, but any way I have tried (none gave errors), the log file remains the same size. I have tied to shrink the log file (through the UI and via DBCC commands) without success; no errors, but also no change in file size.
I have checked Log Reuse Waits, just in case, and as expected it showed “NOTHING” (select log_reuse_wait_desc, name from sys.databases)
I tried running a checkpoint, but that did not allow any resize or shrink to work.
I have tied creating large transactions to move the used point in the log file, in case this was the issue. I did this by creating tables that I drop after large inserts. While it shows me that the log space % used increased, the log file still does not allow the space to be reduced.
The following is what I was using for the transactions to get the log used.
BEGIN TRAN
select a.* into testtable from sysobjects a, sysobjects b, sysobjects c
ROLLBACK TRAN
Each insert creates 93,576,664 rows.
Running dbcc SQLPerf(logspace) :
DBLogSize(MB)LogSpaceUsed(%)Status
SomeDB2181.534.204890
Running dbcc loginfo:
RecoveryUnitIdFileIdFileSizeStartOffsetFSeqNoStatusParityCreateLSN
0211437342728192602640
02114373427211437424645701280
Do I just need to continue running large transactions until the log space used gets high enough to get the “end point” in the log to really move? Is there an easier way to accomplish this (I have several DBs that have the almost identical problem), what I am using moves the Log Space Percent Used about a percent on each execution.
View 9 Replies
View Related
Aug 10, 2006
I am new to windows apps in .net 2.0. I am trying to create a windows service that will connect to a database and email info out to people that have had status changes.
Right now, I can not connect to the database. Here is the connection string:
Private cnn As New SqlClient.SqlConnection("Data Source=IPAddress;Initial Catalog=TheServer;Persist Security Info=True;User ID=userid;Password=password provider=SQLOLEDB.1;connect timeout=3600")
This is how I am trying to connect:
cnn.Open()
myCMD.CommandTimeout = 0
dr = myCMD.ExecuteReader
I keep getting an error message that I can not be logged on. I know that the credentials are correct because I use them for the web app. Something has to be wrong with my connection string, but what?
Thanks,
enak
View 2 Replies
View Related
Sep 1, 2006
I'm using Visual Web Developer and SQL 2005...It Guives me this error...: 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) I'm tired of guetin and search solution for this errorI've tried everything that i searched over the "net"...made all the configurations possible in sql server 2005 and nothing...Is this right? Or do i need to put some more code in this line or in server is it "localhost:****...: ...connection = New SqlConnection("Server=servernameWebSite1uid=sa;pwd=1234;database=cdcollection")connection.Open()...... Don't know why in sql server i have two object explorer connections when i start the sql server...one is "servername"...two is "servernamesqlexpress" (but when trying to connect with "servernamesqlexpress" it won't let me, only with "servername")...i use the windows authentication......when i had the VB.NET 2003 and SQL Server 2000, it was much easy to do this... In ASP.NET config i still have the C:inetpubwwwroot path but the files don't go there...now they go to my documentsVisual studio 2005 by default of Visual Web Developer prog. Do i need to change the location? Please help...i'm really desperate...with this...
View 2 Replies
View Related
Nov 1, 2006
I am developing my first website for my boss. I am trying to connect to an access database which I have created a DSN for on the server. I am using the following code sample.... //Connection String 1string dsn_name = "access_WALLINVEN.dsn";string sDSNDir = Server.MapPath("_dsn");string connectstr = ("Data Source="+ (sDSNDir + ("\" + dsn_name)));//Connection String 2string connectstr = "Data Source=/jwallpaint/_dsn/access_WALLINVEN.dsn;Uid=jwallpaint;Pwd=J2512wall;";string commandString = "Select * from Inventory";//Pass strings to sqlDataAdapter constructorSqlDataAdapter dataAdapter = new SqlDataAdapter(commandString, connectstr);//Create a datasetDataSet dataSet = new DataSet();//fill the dataset objectdataAdapter.Fill(dataSet, "Inventory");//Get the table from the datasetDataTable dataTable = dataSet.Tables["Inventory"];//Bind to the gridviewGridView1.DataSource = dataTable;GridView1.DataBind();For Connection String 1 I get the error of...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) For Connection String 2 I get the error of...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) I am not sure which connection string to use either....It is strange to me that I get this error talking about SQL Server when I am trying to reach my Access database......Any Help?? Thanks....
View 1 Replies
View Related