Microsoft Sql Server Management Object--Getting Problem In Defining DataType
Mar 28, 2008
Hiii
I am working on a application where I will upload my excel sheet.Then the application will read the header and will create a table to store the excel sheet.
When the excel sheet will be uploaded first it will read the header of the excel and will display it inside a gridview to choose which columns are to be created along with datatype.I am giving u a snapshot
Column Name
Select
Datatype
Group Code
Emp No
Mem code
Amount
So Here the user is selecting tha data type.So I am passing the data type to my functions.But while assigning the datatype I am getting error that can no convert from sting to Microsoft.SqlServer.Management.Smo.DataType.I am giving u the demo codeprivate void button1_Click(object sender, EventArgs e)
{ServerConnection objsvrconn = new ServerConnection();
objsvrconn.LoginSecure = false;objsvrconn.ServerInstance = "DEMO";
objsvrconn.Login = "sa";objsvrconn.Password = "sa";
Server objsvr;objsvr = new Server(objsvrconn);
//objsvr.ConnectionContext.Connect();Table tb = objsvr.Databases["Demo"].Tables["Temp"]; Column c = new Column(tb, "GrpCode");
DataType dt = new DataType();dt.SqlDataType =(DataType)"Varchar" ---I am getting the error here.It only accecept from a enum i.e Datatype.Typename but doesnot accept like this
dt.MaximumLength = 10;
c.DataType = dt;
tb.Columns.Add(c);
tb.Alter();
}
Please help me.
View 4 Replies
ADVERTISEMENT
Jan 25, 2008
In Sql Server 2005, Sql Server Mangerment Studio 9.00.1399.00
I connected an user instance to the databases under .SQLEXPRESS(SqlServer 9.0.3042 -....)
when I right click on a table
and chose modify, or new table...
I get
TITLE: Microsoft SQL Server Management Studio
------------------------------
Unable to cast object of type 'Microsoft.SqlServer.Management.Smo.Urn' to type 'Microsoft.SqlServer.Management.Smo.Urn'. (SQLEditors)
------------------------------
BUTTONS:
OK
------------------------------
same thing for views
What can I do to fix the problem? is there a patch?
btw script .... as seem to be erro free Error free is also View dependence,
View 3 Replies
View Related
Apr 8, 2008
Hi Everyone,
Please help me on this issue. I'm a new SSIS User.
I've installed Sql Server 2005 Developer Edition
When I create a new SSIS Project in Business Intelligence Development Studio,
I get the following message:
"Microsoft Visual Studio is unable to load this document: Object reference is not set to an instance of an object".
Error loading 'package.dtsx'bject reference is not set to an instance of an object
When I try to debug the package, I get the below message:
parameter Component(System.Design) is null.
I've uninstalled and installed SS 2005 several times, yet the problem persists.
Please help.
This is the package.dtsx
<?xml version="1.0"?><DTS:Executable xmlnsTS="www.microsoft.com/SqlServer/Dts" DTS:ExecutableType="MSDTS.Package.1"><DTSroperty DTS:Name="PackageFormatVersion">2</DTSroperty><DTSroperty DTS:Name="VersionComments"></DTSroperty><DTSroperty DTS:Name="CreatorName">USkothand1</DTSroperty><DTSroperty DTS:Name="CreatorComputerName">US6051KOTHAND1</DTSroperty><DTSroperty DTS:Name="CreationDate" DTSataType="7">4/8/2008 10:53:39 AM</DTSroperty><DTSroperty DTS:Name="PackageType">5</DTSroperty><DTSroperty DTS:Name="ProtectionLevel">1</DTSroperty><DTSroperty DTS:Name="MaxConcurrentExecutables">-1</DTSroperty><DTSroperty DTS:Name="PackagePriorityClass">0</DTSroperty><DTSroperty DTS:Name="VersionMajor">1</DTSroperty><DTSroperty DTS:Name="VersionMinor">0</DTSroperty><DTSroperty DTS:Name="VersionBuild">0</DTSroperty><DTSroperty DTS:Name="VersionGUID">{FBD98635-EDDE-4F58-9D53-356E8CB653FB}</DTSroperty><DTSroperty DTS:Name="EnableConfig">0</DTSroperty><DTSroperty DTS:Name="CheckpointFileName"></DTSroperty><DTSroperty DTS:Name="SaveCheckpoints">0</DTSroperty><DTSroperty DTS:Name="CheckpointUsage">0</DTSroperty><DTSroperty DTS:Name="SuppressConfigurationWarnings">0</DTSroperty><DTSroperty DTS:Name="ForceExecValue">0</DTSroperty><DTSroperty DTS:Name="ExecValue" DTSataType="3">0</DTSroperty><DTSroperty DTS:Name="ForceExecutionResult">-1</DTSroperty><DTSroperty DTS:Name="Disabled">0</DTSroperty><DTSroperty DTS:Name="FailPackageOnFailure">0</DTSroperty><DTSroperty DTS:Name="FailParentOnFailure">0</DTSroperty><DTSroperty DTS:Name="MaxErrorCount">1</DTSroperty><DTSroperty DTS:Name="ISOLevel">1048576</DTSroperty><DTSroperty DTS:Name="LocaleID">1033</DTSroperty><DTSroperty DTS:Name="TransactionOption">1</DTSroperty><DTSroperty DTS:Name="DelayValidation">0</DTSroperty>
<DTS:LoggingOptions><DTSroperty DTS:Name="LoggingMode">0</DTSroperty><DTSroperty DTS:Name="FilterKind">1</DTSroperty><DTSroperty DTS:Name="EventFilter" DTSataType="8"></DTSroperty></DTS:LoggingOptions><DTSroperty DTS:Name="ObjectName">Package</DTSroperty><DTSroperty DTS:Name="DTSID">{191D188C-EA6E-46D6-A46A-8C9F3C21C321}</DTSroperty><DTSroperty DTS:Name="Description"></DTSroperty><DTSroperty DTS:Name="CreationName">MSDTS.Package.1</DTSroperty><DTSroperty DTS:Name="DisableEventHandlers">0</DTSroperty></DTS:Executable>
Thanks
Best Regards
View 12 Replies
View Related
Feb 7, 2008
Regarding Server Management Object (SMO) and (DMO) Data Management Object.
While Querying the Named instance of particular SQL Server it is giving Exception "An exception occurred in SMO while trying to manage a service" for this what is the solution...?
View 4 Replies
View Related
Oct 18, 2006
Hi,im trying to learn SQL Server Management Expressknow a good place to start?Im trying to upload an sql database from Visual Web DeveloperIve been told that this can be done using SQL Server manegement express...cant see how to import into it yet.... any ideas?
View 2 Replies
View Related
Mar 10, 2008
i try to open database table using Microsoft SQL Server Management Studio i got the follwing error msg i don't know what the problem
===================================
Object reference not set to an instance of an object. (SQLEditors)
------------------------------Program Location:
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.OpenTableNode.CreateDesigner(IDTDocToolFactoryProvider factoryProvider, IVsDataConnection dataConnection) at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDataDesignerNode.CreateDesigner() at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDataDesignerNode.Open() at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VirtualProject.Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ISqlVirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con) at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ISqlVirtualProject.CreateDesigner(Urn origUrn, DocumentType editorType, DocumentOptions aeOptions, IManagedConnection con) at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.CreateDesignerWindow(IManagedConnection mc, DocumentOptions options)
View 1 Replies
View Related
May 9, 2008
I was looking for Microsoft SQL Server Management Studio but downladed Microsoft SQL Server Management Studio EXPRESS.
the express version doesn't have the SQL server agent. I read that the express doesnt support SQL server agent. Is there any add-on or service pack available for this.
I am trying to find "SQL server Management studio". Any idea where I can download it?
View 3 Replies
View Related
Apr 3, 2007
Hi,
How to create Trigger in "SQL SERVER 2005 - Microsoft SQL Server Management Studio"? This is my 1st interaction with SQL SERVER 2005.
Thanks,
Rahul Jha
View 2 Replies
View Related
Feb 25, 2008
Hi all,
I am Vaibhav.I am using Microsoft SQL Server Management Studio 9.00.1399.00 on my machine , which have Windows 2000 Professional OS installed. Now I am upgrading My ystem to Windows Vista OS.
And I am not getting whether Microsoft SQL Server Management Studio 9.00.1399.00 will support Windows Vista? or I have to go for Higher version available for Microsoft SQL Server Management studio ?
Please asist me on same.
Thanks,
Vaibhav Tare
View 1 Replies
View Related
Mar 7, 2008
Is Microsoft SQL Server Management Studio Express (sql 2005) compatible with Sql Server 2000 databases?
I'm using Windows Vista and the sql 2000 Enterprise Manager is not fully compatible with Vista...long not responding messages.
Can i use the client version of Slq 2005?
Regards
View 1 Replies
View Related
Jul 23, 2005
Dear all,On Win2000 server with SP3, I am trying to access a SQL Server 7.0database, "TestDB", from VB6 via a SQL Server ODBC system DSN using ADO2.7. In SQL Server Enterprise Manager, there is a login named "Tester".In its property window, NO "Server Roles" was assigned but its"Database Access" was set to "TestDB". This login was also made as theuser of "TestDB" with "public", "db_datareader" and "db_datawriter"selected as its "Database role membership". All the tables I am tryingto access in "TestDB" were created under "Tester".My code is like:Set conn = New ADODB.Connectionconn.Open "DSN=TestDSN;UID=Tester;PWD=test"Set cmd = New ADODB.Commandcmd.ActiveConnection = conncmd.CommandText = SQLset rs = cmd.Execute()If I set the SQL to something like "SELECT * FROM tbl_test", I alwaysget an error of "-2147217865" saying "[Microsoft][ODBC SQL ServerDriver][SQL Server] Invalid object name tbl_test". If I set the SQL to"SELECT * FROM Tester.tbl_test", everything runs properly. Could anyoneplease kindly advise why the first SQL is not working? Or in otherwords, why must I prefix the table name with its owner while the DBconnection is already made under that owner name? Thanks in advance.Tracy
View 10 Replies
View Related
Mar 30, 2007
Microsoft SQL Server Management Studio ExpressI have restored the database into it with 100tables and stored procedures.I have also created the new database in it.But,i don't know how to add the existing database in to Visual Studio.Net 2005 .I m using ASP.Net.Where are the database stored ?? I don't want to create the new database,.Can anyone pls tell me ....
View 1 Replies
View Related
Feb 27, 2008
I was having some trouble with the DTS Wizard and so I thought I'd just reinstall the whole MSSM. I used remove programs, rebooted my Vista computer and am trying to reinstall the Server Express Toolkit. It tells me that MSSM already exists on my computer (which it doesn't).
The actual screen reads:
Existing components
The following components that you chose to install are already installed on the machine.
Grayed out -- Workstation components and development tools 9.2.3042.00
How do I reinstall MSSM now? It's gone from my computer.
Thanks!
View 3 Replies
View Related
Sep 13, 2006
Hi,
Was trying to open AdventureWorks when i got this error: "There is no editor available "C: Program Flies.....AdventureWorksDW_Log.LDF'
Make sure the application for the file type(.LDF) is installed.
How can this error be corrected? I also have some error on mdf not installed.May i know how should be the initally steps to be done inorder for me to view this database.
And if i do have a database from microsoft access, what are the steps that i need to do inorder to get it export to Microsoft SQL Server Management Studio Express. Please advise as i really new to it. Thanks!
View 6 Replies
View Related
Jul 24, 2007
Is it possible to create a DTS package using microsoft sql server management studio. if yes? How can i do it.
Any help is appreciated.
Regards,
Karen
View 2 Replies
View Related
Jun 20, 2007
Dear All,
I am trying to connect to a remote sql server 2005. So I have install the Microsoft SQL Server Management Studio Express. When I try to connect I get the error below.
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) (Microsoft SQL Server, Error: 53). Can some one please help. I have even port no 1533 on my pc. Thanks.
View 5 Replies
View Related
Feb 28, 2008
Hi
Apologies for this question
I have just found out i/we need to upgrade to the full version of this management tool to make use of SSRS for a new CRM we are putting in place, The CRM company tells me we can just install the tool from our SQL 2005 disk.
Im wondering what the best way to go about this is? i would guess we just un-install the express version install the full version of the management tool and reconnect to the database. unless im missing anything?
thanks
View 1 Replies
View Related
Aug 16, 2007
I am trying to copy a database from the server on my web host(crystaltech) to my new local install of MS SQL Server 2005 Enterprise (trial version).
I go to Tasks>Copy Database which opens the wizard. When I get to the select database screen I get this error:
Server user 'username' is not a valid user in database '123foo'
(123foo is the first database of all those on the server)
I need have it look only at my database which I have permissions for to copy it. How do I do this?
I tried copying the tables the other way(import data) but it dropped all my identities and primary keys which is a pain to recreate. Is there a way to copy tables from one server to another without losing primary keys and identity fields?
Thanks for any help!
View 3 Replies
View Related
Jan 11, 2006
Hello,
I'm trying to import some tables from another sql server to my laptop. I just downloaded Microsoft SQL Server Management Studio Express and i'm not sure how to import things. Could anyone help me with that?
Thanks a bunch
j
View 9 Replies
View Related
Sep 15, 2006
When I try to connect to the Reporting Services using Microsoft SQL Server Management Studio, the following error message propmpts up:
_____________________________________________________________
ADDITIONAL INFORMATION:
The request failed with HTTP status 401: Unauthorized. (Microsoft.SqlServer.Management.UI.RSClient)
_____________________________________________________________
Is there any settings that I need to do in the "Reporting Services Configuration Manager" ?
Thanks.
Best regards,
Michael Wu
View 1 Replies
View Related
Jan 18, 2007
Hello,
i don't know if it was mentioned before, but i solved the issue that Microsoft SQL Server Management Studio Express won't show the option to create/modify a sql compact database by installing not this Version:
Microsoft SQL Server Management Studio Express
Date: 19.04.2006
http://www.microsoft.com/downloads/details.aspx?FamilyID=c243a5ae-4bd1-4e3d-94b8-5a0f62bf7796&DisplayLang=en
but this one:
SQL Server Management Studio Express Service Pack 2 €“ CTP-Version
Date: 19.12.2006
http://www.microsoft.com/downloads/details.aspx?FamilyID=ccbda432-8ecf-4c82-bdef-b575eaf07f55&DisplayLang=en
hope this helps.
Nihat
P.S. i'm curious if anybody else had the same issue, caused of using the wrong Version of SSMSe?
View 1 Replies
View Related
Oct 26, 2006
I everybody,
I'm trying to download Microsoft SQL Server Management Studio Express from
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796
However, the download never finishs.
If I try to download using a download manager it stops after 98% (the segment that stops is the first segment).
If I try to download without a download manager it stops after 1% (456Kb).
What can I do?
Is there an alternate place where I can download the file?
Thanks,
Nadav
View 4 Replies
View Related
Apr 25, 2008
hello,
I have a question about opening files in the Microsoft SQL Server 2005 Management Studio.
In the old Query Analyzer from SQL 2000 I can open SQL Files via drag & drop (from explorer to QA) or open it with a double click in the explorer. Then the Files opened, if I had actual a connection to a server / database (QA is stared with one file and has a connection to Server/Datebase), with this connection.
Now in Microsoft SQL Server 2005 Management Studio I'll be asked everytime for Server and have to get the database from the database list - it does not connect automaticly to server/database, that is actual connected (I have opened a file with the connection and a connected database in the object explorer).
Someone do not have this problem - but we found no option to set it up.
Any ideas?
thanks &
best regards,
Christian Kiedels
View 9 Replies
View Related
May 21, 2008
I get the error below when trying to modify a table or colum with MSSMS. I can expad out the tree and look at the columns, but I can't change them, view the data in them, or create new ones.
__________________________________________________________________________________________________________________________________
TITLE: Microsoft SQL Server Management Studio
------------------------------
Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)
I resintallelled .NET Framework, recommended from another post. I am using .NET 3.5 BETA Frame work, ans SQL Server 2005 V 9.00.139.00
View 2 Replies
View Related
Apr 11, 2006
How does one export/copy a database using Microsoft SQL Server
Management Studio Express? At this time, I have an existing
database that I can access and run queries against. However, I
cannot connect to it via Visual Wed Developer 2005 Express. At
this time, I'm getting the following error message with the existing
database:
Login failed for user 'bigide2_gims2'. The user is not associated with a trusted SQL Server Connection.
Next, I'm running everything locally. If anyone can assist, it would be greatly appreciated and thanks in advance.
-Conrad
View 1 Replies
View Related
Jul 14, 2006
Morning,
I installed the managerment stuid on my machine and now none of my database connections seem to work any more. I keep getting the attached error. Before I installed the studio the system worked fine, I could connect to the database and everything was fine. Does the studio change any permission stuff? I cannot seem to get it to work again at all now, I added in aspnet as a login inside the studio and it still won't let me connect to the database. I cannot find *any* logs anywhere that might be helpful in what it is doing or see any way to debug the connection to find out what the problem is. When I look at the permissions inside of the studio it shows me that the connections should all be fine.
I checked and remote and local connections are setup, although it is only doing local connections anyway since this is a asp.net web server page.
Any idea what the problem is here? This is very frustrating and annoying :( Since I didn't change anything and now nothing I will do gets it to work. I even tried to uninstall the management tool and it still doesn't work.
Cannot open user default database. Login failed.
Login failed for user 'GREENANDFLUFFYASPNET'.
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: Cannot open user default database. Login failed.
Login failed for user 'GREENANDFLUFFYASPNET'.
View 5 Replies
View Related
Jul 22, 2007
This is a problem that never get solved, sometime I can use other way to avoid it, but havn't found a solution yet, i hope I can get some more idea here.
I am using SQL 2005, when I run
select * into #import1
from OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;hdr=yes;database=\ws8webjeff2.xls',
'select * from [jeff2$]')
I get
Cannot initialize the data source object of OLE DB provider "microsoft.jet.oledb.4.0" for linked server "(null)".
when I try to compile a SP with that statement in it, I get the same error, like
create stored procedure test
as begin
select * into #import1
from OpenRowSet('microsoft.jet.oledb.4.0','Excel 8.0;hdr=yes;database=\ws8webjeff2.xls',
'select * from [jeff2$]')
end
so it seems the error may not relate to the real file, since at the compile stage, it should not check the real file?
On my live db, after I restart the SQL service, the statement will work, after a while, one or several days, I get the same error again. I can not restart my live db quite often for sure, so now I have another backup db server, I need run the statement on the backup server and then read the data from there.
I have the same problem at two places, both use SQL 2005.
So far there are three questions
1, why it works after restart, but only last for a while? something about memory? since the backup db seldom need restart and work fine after many days.
2, why it gives error in compile stage?
3, why two dbs in different Enviroment has the same problem
The most answer I have gathered so far is permission issue, true I got similar error if the import file is located in a place which SQL has no right to access. But in this case, it should not be.
Any other idea or suggestion?
thanks
View 2 Replies
View Related
Sep 4, 2007
Hello,
I'm new to SQL server 2005. I installed SQL server 2005 and had some problems with the original install. I therefore uninstalled SQL server 2005. Rebooted and than installed SQL server 2005 again. Everything appears to have installed correctly except for the fact that when I start SQL Server Management Suite I get 2 copies running in the foreground. The last copy of the SQL Server Management Suite shows a dialogue box that contain a warning sign (yellow triangle) with no text but an OK button is in the dialogue box. When I press the OK button, this instance of SQL Server Management Suite kills itself. The first instance is now given window focus and it brings up the "Connect to Server" dialogue box. I can connect to my local server and run a script to add columns to the database. But everytime I bring up SQL Server Management Suite, I always end up with 2 copies running and I have to hit the OK button to get rid of the second copy. Can anyone help me get ride of this annoying problem?
View 1 Replies
View Related
Nov 21, 2007
Hi all,
I just found that the content of my Database "ssmsExpressDB" is gone, but the name "ssmsExpressDB" remains in the Object Explorer of SQL Server Management Studio Express. If I delected the name "ssmsExpressDB" and executed the following .sql:
exec sp_attach_db @dbname = N'ssmsExpressDB',
@filename1 = N'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB.mdf',
@filename2 = N'C:Program filesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB_log.LDF'
GO
I got the following error message:
Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
And I have closed all my projects and I do not know what " The process cannot access the file because it is being used by another process" is all about!? Please help and tell me how I can re-attach the content of my "ssmsExpressDB" in the Object Explorer of SQL Server Management Studio Express.
Thanks in advance,
Scott Chang
====================================================================================
I found the "ssmsExpressDB" is being used by my VB 2005 Express project "Hello-SQLCLR-1": in the Database Explorer, Data Connections place. How can I put it back to the Object Explorer of SQL Server Management Studio Express? Please help and advise.
=======================================================
View 6 Replies
View Related
May 8, 2008
Hi,
I have a script component that contains a script similar to that shown below;
Public Sub Main()
Dim sqlConn As New SqlConnection("Server=myserver;Database=mydb;Trusted_Connection=True;")
Dim SQLStmt As String
SQLStmt = "select top 10 CountID from mytable"
Dim sqlComm As New SqlCommand(SQLStmt, sqlConn)
sqlConn.Open()
Dim r As SqlDataReader = sqlComm.ExecuteReader()
While r.Read()
Dim MyValue As Integer
If r("CountID") IsNot DBNull.Value Then
MyValue = CInt(r("CountID "))
' HERE I WANT TO WRITE MyValue TO A PACKAGE VARIABLE AS A ROW
End If
End While
r.Close()
sqlConn.Close()
Dts.TaskResult = Dts.Results.Success
End Sub
Once i have a value assigned to MyValue, I want to write this as a row to a variable (DATATYPE Object Value VALUE System.Object) in the package which will be an ADO Recordset Destination that i can then loop through later.
Many thanks for any help
Phil Harbour
View 1 Replies
View Related
May 1, 2007
Hi All,
Here is a description of the issue I'm facing about decimal datatype conversion from DB2 to SSIS throught Microsoft OLE DB Provider for DB2.
I first discovered it when I tried to use a LookUp trans. and selected a decimal typed field. I was unable to validate it and clicking the OK button threw the error copied below:
TITLE: Microsoft Visual Studio
------------------------------
Error at Data Flow Task [DTS.Pipeline]: The "output column "MFIXFRA" (317)" has a value set for length, precision, scale, or code page that is a value other than zero, but the data type requires the value to be zero.
------------------------------
ADDITIONAL INFORMATION:
Exception from HRESULT: 0xC0204019 (Microsoft.SqlServer.DTSPipelineWrap)
------------------------------
BUTTONS:
OK
------------------------------
Some workarounds on this issue led me to two other strange behaviours:
- If I create a dataflow task to perform a raw copy of a DB2 table to a brand new table in SQLServer destination (by clicking "new" instead of choosing an existing destination table), generated "create table" script for decimal fields is quite different from source table. For example, a source field declared Dec(15,2) is translated as Dec(29,5), and so on.
- Quite same behaviour if I try to derive a column using as derived column trans. If the source column is a decimal, it's scale and precision are interpreted ramdomly.
Any idea welcome
André
View 6 Replies
View Related
Feb 27, 2008
Hi all,
In my SQL Server Management Studio Express (SSMSE)=>Object Explorer=>Databases, the "NORTHWND" database was screwed up and is deleted completely. But under the same Object Explorer =>Databases, there is a database "C:SSMSE-BookChapter12WINCH12NORTHWND.MDF". I need to use this "NORTHWND" database in the SqlConnection. How can I specify the "Initial Catalog" (or "database") in the New SqlConnection code statement (in the ADO.NET 2.0-VB 2005 Express programming)?
Should it be like the following:
Dim sqlConnection As SqlConnection = New SqlConnction("Data Source=.SQLEXPRESS; Initial Catalog=C:SSMSE-BookChapter12WINCH12NORTHWND; Integrated Security=SSPI;") ? Or what is the right code statement for connecting to it?
Please help and advise.
Thanks in advance,
Scott Chang
View 7 Replies
View Related