Does SQL Server 2005 Express Support Web/Internet Replication To Other SQL Server Express Clients?

Jan 22, 2007

HI

Q1: Does Sql Server 2005 Express support Web/Internet to other SQL Server 2005 Express Clients or does it have to Synch across the internet to a fully installed setup SQL Server 2005 with IIS?

Q2: Does SQL Server 2005 Express support Direct Replication between other SQL Server 2005 Express clients?

Regards

View 5 Replies


ADVERTISEMENT

SQL Server 2005 Express Database On The Internet

Jul 12, 2006

Hey all!I am hoping that somebody will be able to help me getting my database working over the Internet.I am using VS 2005 and SQL Server 2005 Express Edition and have my database set up within a web site project in VS under the App_Data folder.Everything runs smoothly when running the application on localhost I am just facing a problem when I attempt the same thing after uploading my pages to my web server.I am receiving the following 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 have tried enabling the disabled SQLEXPRESS protocols and disabled my firewall with no luck.I have also looked into using localhostsqlexpress as the server name but I dont see how this method would work as it appears to only run a database on the local machine which is the problem I have currently.Could anybody help me with this problem? I have only just started trying to use SQL Server Express as a means of database connectivity and I am not exactly sure how it all works.Thanks

View 1 Replies View Related

Connection Sql Server Express 2005 Over Internet ?

May 24, 2007

Is it possible to connect to a sql server express over internet or not ?

- I am using a win2003 sp1 server. Freshly installed.
- The server is directly connected to internet.
- For the purpose of the test, I stopped the windows firewall and the IPSec service.
- I stopped SQL server Browser service.
- I find a free port (here : 1401)
- I activated TCP/IP protocol in SQL Server Configuration Manager, and I have selected 1401 as the TCP port in the IPAll sextion of TCP/IP protection (and I remove the '0' of the dynamic TCP Port).
- Restarted SQL server express...

In the sql server log, I get the message "Serveur Server is listening on [ 'any' <ipv4> 1401]"

But I never get an answer from the server.

sqlcmd -S ip_of_the_server, 1401 -U username -P password is working fine if launched on the server. But I always get a timeout error from any PC. Same with a telnet on port 1401.

Any idea ?



-

View 8 Replies View Related

Does SQL Server 2005 Express Support XQuery Static Type Analysis?

Jan 1, 2007

I am quite curious about SQL Server 2005 Express, since I am conducting an XQuery implementation survey for my thesis study.

Yet I still got some questions and may need your help:

1. Does SQL Server 2005 Express support XQuery static type analysis (from http://www.w3.org/TR/xquery-semantics/)?

2. If so, since the W3C standard is still changing, how do you keep up
with the change efficiently?

Your help will be appreciated.
Happy New Year and Thank you,

Selina, Wang

View 1 Replies View Related

Configuring SQL Server Express In SqL Server 2005 Pro To Support MSVisual C# 2005 Step By Step

Feb 4, 2007

Visual C# 2005 Step by Step €“ John Sharp

Intel D975XBX €“ 930 €“ 2GB ram €“ HD 300GB - MatroxVD
Windows XP Sp2 + updates
Visual Studio 2005 Professional edition
SQL Sever 2005 Standard Edition

20070203
Install Practice Files at D:Program FilesMicrosoft PressVisual C Sharp Step by Step.

Configuring SQL Sever Express Edition
Hostname - xxxxxxxxx..

At sqlcmd €“s xxxxx...SQLExpress €“E got - Pipes error.

Open Microsoft SQL Sever 2005 - Configuration Tools €“ SQL Configuration Manager €“ select Protcols for SQLEXPRESS €“ select Named Pipes €“ enable €“ close.

At sqlcmd €“s xxxxx..SQLExpress €“E get Sqlcmd: €˜ €˜ : Unknown Option. Enter €˜ -? €˜ for help.

Chdir C:Documents and SettingsAll UsersStart MenuProgramsMicrosoft Server 2005
Sqlcmd €“s xxxxxx..SqlExpress €“E
Hresult 0x2, Lvel 16, State 1
Named Pipes Provider: Couldnot open a connection to SQL Server [2].
Sqlcmd: Error: Microsoft SQL Native Client : 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..
Sqlcmd: Error: Microsoft SQL Native Client : Login timeout expired.

How do I fix this?

Need to be able to to use the Northwind Traders data base

Thanks

View 1 Replies View Related

SQL Server Replication To SQL 2005 Express

Oct 31, 2006

Hello,

I am facing problems trying to replicate SQL Server 2000 table to SQL 2005 Express. The error says:

"login failed for user 'username'. The user is not associated with a trusted SQL server connection"

PS:
The same happens when I try to register the SQL 2005 server in SQL 2000 Enterprise Manager.


Any help?

Thanks
Walid

View 5 Replies View Related

How To Apply SQL Server 2005 Express SP1 To The Version Of SQL Server 2005 Express Which Installs With Visual Studio 2005?

Aug 8, 2006

When I installed VS 2005, it installed the default version of SQL Server 2005 Express that ships with Visual Studio 2005 installer media.

How can apply SQL Server 2005 Express SP1 to update this existing instance?

Currently, if I run this query:

SELECT @@version

I get the following:

Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

After applying SP1, I should get 9.00.2047.00.


Should I just go to this link and download & install the SQL Server 2005 Express Edition SP1:

http://msdn.microsoft.com/vstudio/express/sql/download/


Thank you,

Bashman

View 11 Replies View Related

Replication From Sql Server 2000 To Sql Express 2005

Sep 15, 2006





I want to replicate data from sql server 2000 to a sql server express 2005 box.

I can dts data across..but I want to be able to set up push replication from the Sql Server 2000 box, but the option to push the data to the Sql Express server in the GUI does not come up only Sql Server 2000 boxes are listed. Initially I will be using Snapshot replication but would like to eventually move on to transactional rep if only I can get it to push the data across.

Does anyone know how to acheive this thanks for any help Sammy.









View 3 Replies View Related

Seting Up Sql Server Express For Internet Connection

May 7, 2007

Hi

Im having some problems setting up sql server so that i can connect to it in my vb program over the internet.

Im using windows xp pro and have IIS installed and using sql server 2005 express SP2.

My setup is as follows:

from phonecable to router, from router to wireless access point and the wireless connects to my computer.

I have tried disabling the xp firewall, and in the sql server configurationi have set the port to 11001, which i have also opened in my router.

There should be a connection to the computer, cause i have succesfully set up an FTP server on a different port.

I have also enabled remote connections, both via TCP/IP and named pipes.

I have tried to use telnet on my IP adress with the port 11001, and it says that i cant create a connection..Are there other settings i should set to get this to work? This has been bugging me for a little while...

View 1 Replies View Related

SQL Server 2005 Express Edition Performance And Replication

Feb 25, 2008

Wondering if anyone has any experience with SQL Server Express Edition (SSEXP). We're looking at a mobile sales force type model, so a local database on a laptop with no real time network connection. So the users would collect data locally, then connect up to the network every few days to replicate the data to a central server.
So questions.. Has anyone tried anything similar? How stable/mature is SSEXP? Any other thoughts, alternatives or gotchas anyone can think of?

Thanks for the input.

View 1 Replies View Related

Implement Manual Replication Between Two SQL Server 2005 Express?

Mar 2, 2007

Hi,

I need to synchronize the data between two SQL Server 2005 Express.

The database is really simple, just few tables (but data are inserted very often) without any triggers.

Since Express edition could not behave as a Publisher I was thinking about implementing manually a sort of Replication mechanism... It should be a sort of Transactional Replication with queueud updating.

Does it sound a good idea?
Has anyone done this before o there are better solution?

Thanks in advance,
Stefano

View 6 Replies View Related

SQL 2005 Server (SP2) To SQL 2005 Express (SP2) Replication Looping/Excessive Repl Times

Sep 25, 2007

We have a large number of clients attempting to replicate two publications on 2005 Express databases (2 publications subscribed to the one subscriber database) with our 2005 Server (9.00.3042.00 SP2 Standard Edition) and experiencing two significant problems:

1) Users experience the following message:

The Merge Agent failed after detecting that retention-based metadata cleanup has deleted metadata at the Subscriber for changes not yet sent to the Publisher. You must reinitialize the subscription (without upload).

This problem should not apparently occur with SQL Server 2005 (or 2005 Express) instances with SP2 applied. All clients experiencing this problem have SP2 installed as does our Server and the retention period is 30 days. The subscribers have been replicating well under that.


2) Replications never succeed after appearing to replicate/loop around for hours

This issue is the most critical as we have clients who have been installed and re-installed with new instances of SQL Server 2005 Express, new empty databases (on subscriber before snapshot extraction), and using fresh snapshots (less than an few hours old) which cannot successfully replicate.

Interestingly there is at least 1 instance where several computers are subscribed and successfully replicating the same database as another where replication refuses to succeed.

To test we have taken a republished database from another 2005 Server which is working fine and restored it to the same server as the one holding the database with which we are experiencing problems and subscribed to it. This test worked fine and replication of both publications went through fast and repeatedly without showing any signs of problem.

This indicates that the problem is perhaps data related as it appears localised to that database.

Below are two screenshots which may assist.

Screenshot 1 Shows that on the server side the replication attempts look like they are succeeding despite the fact that the subscriber end does not indicate success. Also the history indicates the the subscription has spent all it's time initialising and not merging any changes.

Screenshot 2 Shows a rogue process which has appears on many of the problem child subscribers. It shows a process running with no end time even though the job indicates failure in the message and even though other replication attempts appear to have succeeded after it. This process stays in the history showing that it is running even when I can find no corresponding process for it.

Can anyone suggest a further course of action/further testing/further information required which may assist?

This is extremely urgent and any assistance would be greatly appreciated!

Thanks in advance!

Scott

View 5 Replies View Related

Upgrading From Sql Server 2005 Express Edition To Sql Server 2005 Express With Advanced Services

Oct 4, 2006

If i have been using sql server 2005 express for developing my application and i decide to upgrade to sql server 2005 express with advanced services while still working on the same application, what will happen to my  application's database. Can i be able to continue with my work with out any major regrets.

View 1 Replies View Related

VB Express SQL Expert Needed For Merge Replication Support.

Sep 3, 2006

I have done a couple of little projects in VB express and was pleased with the results. Now I have something bigger in mind and need to know if VB express version of SQL will support merge replication. If not will the full version support it?
Thanks
Dave

View 3 Replies View Related

SQL Server 2005 Express Edition With SQL Server Management Studio Express (SSMSE)

Jun 7, 2007

Hi all,

I have installed SQL server 2005 express edition with SQL server Management studio express (SSMSE).

I have installed also SQLce and I would know how I can manage sql compact edition databases (.ldf) with sql SSMSE, if it is possible!

I would be grateful if you could explain it trought a detailed guide (I am a beginner user of sql server tools) or trought a link to useful sites.

I'm Looking forward for your reply and still trying...

Alessandro

View 1 Replies View Related

Edited Data Won't Propagate Back To The Database (VB 2005 Express &&amp; SQL Server 2005 Express)

Dec 11, 2006



Hi,

I'm trying to learn some VB programming with the VB 2005 Express Absolute Beginner Series video tutorials (which I think is great) and have come across a problem that I can't solve.

When I follow the instructions in Lesson 9 (Databinding Data to User Interface Controls) my application will display the data from the database correctly and I can edit it (and as long as the debugger is running the data remains changed). However, the changes won't propagate back to the database. I don't get any error messages but after I edit the data, save (with the save button on the BindingNavigator toolbar), and end debugging the data in my database remains unchanged. When I use a MessageBox to show how many rows where edited/updated in the

Me.myTableTableAdapter.Update(Me.myDatabaseDataSet.myTable)

I get the correct number back. I'm sure the problem is not due to coding errors since I've also tried running the accompanying Lesson 9 project file that can be downloaded from MSDN and the problem persists.

I'm using Windows XP SP2, SQL Server 2005 Express Edition and VB 2005 Express Edition. I've tried installing SQL Server 2005 Express with a number of different settings, including default settings, but it doesn't make any difference.

Would greatly appreciate any feedback on this as I'm keen to resolve this problem so I can get on with the next tutorial lesson.

Thanks,
Ieyasu

View 6 Replies View Related

SQL Server 2005 Replication To Internet Provider (Hoster)

Feb 27, 2007

I have a question and bear with me because I am pretty new to this topic.

I have a SQL SERVER 2005 with a Client Server Application. Now I want to add a Webinterface. Sinice there is no infrastructure for hosting our own server. I want to go to an external hoster/provider.

Now my question is it possiple to replicate a snap-shot of the database to an web hoster?

If yes, what does my hosting package requieres beside SQL SERVER and ASP.NET. Any Services and open ports? What about Security?

When I replicate via push Service from my local SQL SERVER do I have to have a tunnel to the provider? Or external network access to my network via VPN. Or is there a way of doing it via HTTP? HTTPS? (I think I saw some settings about FTP replication...). Because of the Infrastructure Problems mentioned above...

It would be great if someone could give me closer information about this topic...

Links, Ressources, Tipps, Tricks, Tools... just anything... would be appriciated very much...

Thx.

View 3 Replies View Related

Visual Basic .NET 2005 Express && Sql Server 2005 Express Remote Server

Mar 12, 2007

Hi,
 I want to make a component library in Visual Basic.NET and connect to a remote Sql Server. When I create a new DataSet with the wizard, I can only connect to a .mdf file, but not to a Sql Server. With Visual Web Developer I can connect to a Sql server. What is the difference between these enviroments ? How can I do the same with Visual Basic.NET ?
 Thanks in advance.

View 1 Replies View Related

Upgrading From 'SQL Server Express 2005' To 'SQL Server Express 2005 With Advance Services'

Apr 20, 2006

Currently I have following things installed on my Computer





1. SQL Server Express 2005

2. SQL Server Management Studio Express 2005 CTP



I need to install following things

A. Microsoft SQL Server 2005 Express Edition with Advanced Services

B. Microsoft SQL Server 2005 Express Edition Toolkit



Do I need to uninstall any any of 1 or 2?

What should be my path to upgrade these software.









View 8 Replies View Related

How Can I Onnect Visual Basic Express 2005 To A Remote SQL Server Express 2005?

Sep 13, 2006

HiIm trying to connect Visual Basic Express 2005 to a remote SQL Server Express 2005. I cant find how i can do that in VB.net Express.In Web developer there are no problem to connect to a remote SQL server but i cant find it in VB.net Express. The XP with the SQL server that i want to connect to is on the local network. Greatful for help!

View 1 Replies View Related

Visual Basic 2005 Express And SQL Server 2005 Express - Display Image

Jun 13, 2007

Hi Guys,
I created a Product database table using Visual Basic 2005 Express and SQL Server 2005 Express. I have just added a new column [Picture] to the database table, which of course, should store an image or picture of a product. I am writing to kindly ask you guys for help .


i) How do I include image files into this column [Picture]?
ii) How do I get this image to display on Visual Basic 2005 Express form, so that when a product is selected the product image is displayed accordingly?


Your help much appreciated. Thanks.

Paul

View 8 Replies View Related

SQL Server Management Studio Express Support Vista ?

Mar 22, 2008

I cannot copmlete the installation because the error prompted as "Install error and error code is 29506".

Is it cannot be supported Vista ?

Best Regards
KennethCCL

View 1 Replies View Related

How To Enable CLR Integration In SQL Server Express And Create SQLCLR Project In VB 2005 Express?

Aug 31, 2007

Hi all,

In my SQL Server Express (that is installed in my Windows XP Pro PC), SQL Server 2005 Network Configuration has Protocols for SQLEXPRESS. I tried to do "Enabling CLR Integration" in my SQL Server Express: (1) If I clicked on "Surface Area Configuration for Services and Connections", I got an error "An exception occurred in SMO while trying to manage a service, (Microsoft.SqlServer.Smo) Additional information: Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) The operation could not be completed. (WinMgmt). (2) If I clicked on "Surface Area Configuration for Features, I got a different error "Computer localhost does not exist on the network, or the computer cannot be configured remotely. Verify that the remote computer has the required computer has the required Windows Management Instrumentation components and then try again. (SQLSAC) Additional Information: An exception occurred in SMO while trying to manage a service. (Microsoft.SqlServer.Smo). Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum) The operation could not be completed. (WinMgmt). Please help and tell me how I should do to get "Enabling CLR Integration" in my SQL Server Express done and how I can create SQLCLR Project in VB 2005 Express.

Thanks in advance,
Scott Chang

View 6 Replies View Related

How To Get A Remote Connection To SQL Server Express From VB 2005 Express In A Network PC That Is Granted For Administrator Use

Aug 22, 2007

Hi all,

I have SQL Server Express and VB 2005 Express installed in a Microsoft Windows XP Pro PC that is a terminal PC in our office Network. My Network Administrator has granted my terminal PC for Administrator Use. I tried to do the ADO.NET 2.0-VB 2005 programming in my terminal PC and I could not get a remote connection in the Window Form Application via Window Authorization. I do not know how to make this kind of remote connection in my Network. Please help and advise.

Thanks in advance,
Scott Chang

View 6 Replies View Related

How To Configure SQL Server Management Studio Express To Allow Doing Non-User-Instance/ADO.NET 2.0 From VB 2005 Express?

Mar 5, 2008

Hi all,

For the first time, I want to set up the configuration of my SQL Server Management Studio Express (SSMSE) to allow me in doing the non-User-Instance/ADO.NET 2.0 programming from my VB 2005 Express. The SSMSE and VB 2005 Express are in my Windows XP Pro PC that is part of our NT 4 LAN System in our office. I read the article "How to configure SQL Server 2005 to allow remotre connections" in http://support.microsoft.com/kb/914277/ about (i) "Enable remote connections for SQL Server 2005 Express", (ii) Enable the SQL Server Browser service", (iii) Create exception in Windows Firewall, and (iv) Create an exception for the SQL Server Browser service in Windows Firewall. I entered the SQL Server Surface Area Configuration and I could not decide what options I should take for doing the non-User-Instance/ADO.NET 2.0 programming from my VB 2005 Express. I have the following questions on the page of "Minimize SQL Server 2005 Surface Area":
(1) I saw "Configure Surface Area for localhost [change computer]". I clicked on [change computer] and I saw the
following: Select Computer
The Surface Area Configuration of this surface area of this computer or a remote computer.
Specify a computer to configure: O Local computer
O Remote computer
Should I choose the "Local computer" or the "Remote computer" option?
(2) Below the "Configure Surface Area for localhost [change computer]",
I clicked on "Surface Area Configuration for Service and Connections", Select a component and then configure its services and connections: |-| SQLEXPRESS
|-| Database Engine
Service
I picked => Remote Connection
On the right-hand side, there are: O Local connections only
O Local and remorte connections
O Using TCP/IP
O Using named pipes only
O Using both TCP/IP and named pipes
Should I choose O Local and remorte connections and O Using named pipes only?

Please help and tell me what options I should choose in (1) and (2).

Thanks in advance,
Scott Chang

View 10 Replies View Related

I Can No Longer Connect To My SQL Server Express 2005 From Manager Studio Express

Sep 28, 2006

Everything was working fine. I have been able to connect using windows authentication. Then, I went into the ODBC manager to add a data source and it failed to connect so I went back into the Server management studio to modify users. After doing this I now get an error when I try to conenct the management studio to the SQL server.

I wasn't modifying the login for my windows account that I normally use, I was modifying a different one, however I now get the message "An error has occured while establishing a connection to the SQL server. This kind of problem can ocure because the default behavior of the server does not support all connection methods" blah blah.

Does anyone know how I can attach to the server? Or, do I need to somehow remove the server and create a new one? How would I do that?

Thanks in advance for any input.

View 1 Replies View Related

Restoring A Sql 2000 Db In Sql 2005 Express Db With Sql Server Management Studio Express

Mar 21, 2007

As I said in the subject I've a problem trying to restore a backup of a previous db created in sql 2000 server

When I try to do it I recive the following message:

____________________________________________________________________________________
System.Data.SqlClient.SqlError: Il set di backup include il backup di un database diverso dal database 'musica2007' esistente. (Microsoft.SqlServer.Express.Smo)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476

------------------------------
Program Location:

in Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQueryWithMessage(StringCollection queries, ServerMessageEventHandler dbccMessageHandler, Boolean errorsAsMessages)
in Microsoft.SqlServer.Management.Smo.BackupRestoreBase.ExecuteSql(Server server, StringCollection queries)
in Microsoft.SqlServer.Management.Smo.Restore.SqlRestore(Server srv)
____________________________________________________________________________________

What should I do? What's the probem? I've already tried to look for the solution in other messages but I didn't find anything..... Thanks for help,,, by Luke

View 1 Replies View Related

SQL Svr 2005 Express Does NOT Support DTS

Apr 9, 2006

<I posted this message in comp.databases Group and then realized thisis a more MS SQL Svr centric group . ... so re-posting it here.>Gentlemen, any workarounds for DTS in Expression version?My goal is to populate a new DB I created with CSV files ... afterreading through dozens of posts it was apparent that DTS is the way togo and then only to find SS-05 Express doesnot support it.Thanks in advance.George

View 4 Replies View Related

RMO: Replication Between SQL Server 2005 Amd SQL Server 2005 Express

Sep 6, 2005

Hi!

View 14 Replies View Related

Problems Of Remote Connections For Creating A SQLCLR Project In SQL Server Express-ADO.NET 2.0-VB 2005 Express Via Network/LAN

Sep 19, 2007

Hi all,

In my office computer network system (LAN), my Windows XP Pro PC has SQL Server Express and VB 2005 Express installed and I was granted to have the Administrator priviledge to access SQL Server Express. I tried to create a SQLCLR project in my terminal PC.
1) I tried to set up a remote connection to SQL Server Express in the following way: SQL Server EXpress => SQL Server Surface Area Configuration. In the Surface Area Configuration for Service and Connection - local, I clicked on Remote Connection of Database Engine, SQLEXPRESS and I had a "dot" on "Local and remote connections" and "Using TCP/IP only". Then I clicked on "Apply" and "OK" buttons. Then I went to restart my database engine in SQL Server Management. When I went to check SQL Server 2005 Surface Area Configuration, I saw the arrow is pointing to "Service", not to "Remote Connections"!!!??? Is it right/normal? Please comment on this matter and tell me how I can have "Remote Connecton" on after I selected it.

2) After I restarted the database engine (I guess!!), I executed the following project code (copied from a book) in my VB 2005 Express:

//////////////--Form9.vb---/////////////////

mports System.Data.SqlClient

Imports System.Data

Public Class Form9

Dim cnn1 As New SqlConnection

Private Sub Form5_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

'Compute top-level project folder and use it as a prefix for

'the primary data file

Dim int1 As Integer = InStr(My.Application.Info.DirectoryPath, "bin")

Dim strPath As String = Microsoft.VisualBasic.Left(My.Application.Info.DirectoryPath, int1 - 1)

Dim pdbfph As String = strPath & "northwnd.mdf"

Dim cst As String = "Data Source=.sqlexpress;" & _

"Integrated Security=SSPI;" & _

"AttachDBFileName=" & pdbfph

cnn1.ConnectionString = cst

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'Create a command to create a table

Dim cmd1 As New SqlCommand

cmd1.CommandText = "CREATE TABLE FromExcel (" & _

"FirstName nvarchar(15), " & _

"LastName nvarchar(20), " & _

"PersonID int Not Null)"

cmd1.Connection = cnn1

'Invoke the command

Try

cnn1.Open()

cmd1.ExecuteNonQuery()

MessageBox.Show("Command succeeded.", "Outcome", _

MessageBoxButtons.OK, MessageBoxIcon.Information)

Catch ex As Exception

MessageBox.Show(ex.Message)

Finally

cnn1.Close()

End Try

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

'Create a command to drop a table

Dim cmd1 As New SqlCommand

cmd1.CommandText = "DROP TABLE FromExcel"

cmd1.Connection = cnn1

'Invoke the command

Try

cnn1.Open()

cmd1.ExecuteNonQuery()

MessageBox.Show("Command succeeded.", "Outcome", _

MessageBoxButtons.OK, MessageBoxIcon.Information)

Catch ex As Exception

MessageBox.Show(ex.Message)

Finally

cnn1.Close()

End Try

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click



'Declare FromExcel Data Table and RowForExcel DataRow

Dim FromExcel As New DataTable

Dim RowForExcel As DataRow

FromExcel.Columns.Add("FirstName", GetType(SqlTypes.SqlString))

FromExcel.Columns.Add("LastName", GetType(SqlTypes.SqlString))

FromExcel.Columns.Add("PersonID", GetType(SqlTypes.SqlInt32))

'Create TextFieldParser for CSV file from spreadsheet

Dim crd1 As Microsoft.VisualBasic.FileIO.TextFieldParser

Dim strPath As String = _

Microsoft.VisualBasic.Left( _

My.Application.Info.DirectoryPath, _

InStr(My.Application.Info.DirectoryPath, "bin") - 1)

crd1 = My.Computer.FileSystem.OpenTextFieldParser _

(My.Computer.FileSystem.CombinePath(strPath, "Book1.csv"))

crd1.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited

crd1.Delimiters = New String() {","}

'Loop through rows of CSV file and populate

'RowForExcel DataRow for adding to FromExcel

'Rows collection

Dim currentRow As String()

Do Until crd1.EndOfData

Try

currentRow = crd1.ReadFields()

Dim currentField As String

Dim int1 As Integer = 1

RowForExcel = FromExcel.NewRow

For Each currentField In currentRow

Select Case int1

Case 1

RowForExcel("FirstName") = currentField

Case 2

RowForExcel("LastName") = currentField

Case 3

RowForExcel("PersonID") = CInt(currentField)

End Select

int1 += 1

Next

int1 = 1

FromExcel.Rows.Add(RowForExcel)

RowForExcel = FromExcel.NewRow

Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException

MsgBox("Line " & ex.Message & _

"is not valid and will be skipped.")

End Try

Loop

'Invoke the WriteToServer method fo the sqc1 SqlBulkCopy

'object to populate FromExcel table in the database with

'the FromExcel DataTable in the project

Try

cnn1.Open()

Using sqc1 As SqlBulkCopy = New SqlBulkCopy(cnn1)

sqc1.DestinationTableName = "dbo.FromExcel"

sqc1.WriteToServer(FromExcel)

End Using

Catch ex As Exception

MessageBox.Show(ex.Message)

Finally

cnn1.Close()

End Try

'Read the FromExcel table and display results in

'a message box

Dim strQuery As String = "SELECT * " & _

"FROM dbo.FromExcel "

Dim str1 As String = ""

Dim cmd1 As New SqlCommand(strQuery, cnn1)

cnn1.Open()

Dim rdr1 As SqlDataReader

rdr1 = cmd1.ExecuteReader()

Try

While rdr1.Read()

str1 += rdr1.GetString(0) & ", " & _

rdr1.GetString(1) & ", " & _

rdr1.GetSqlInt32(2).ToString & ControlChars.CrLf

End While

Finally

rdr1.Close()

cnn1.Close()

End Try

MessageBox.Show(str1, "FromExcel")

End Sub

End Class
//////////////////////////////////////////////////////////////////////////////
I got the following error messages:
SecurityException was unhandled
Request for the permission of type 'System. Security. Permissions.FileIOPermission,mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'failed that is pointing to the code statement "Dim int1 As Integer = InStr (My.Application.Info.DirectoryPath, "bin")."
Troubleshooting tips:
Store application data in isolated storage.
When deploying an Office solution, check to make sure you have fulfilled all necessary requirments.
Use a certificate to obtain the required permission(s).
If an assembly implementing the custom security references other assemblies, add the referenced assemblies to the full trust assembly list.
Get general help for the exception.

I am a new Microsoft VS.NET Express user to do the SQL Server 2005 Express and VB 2005 Express programming by using the example of a tutorial book. Please help and tell me what is wrong in my SQLCLR sep-up and project coding and how to correct the problems.

Many Thanks in advance,
Scott Chang

View 3 Replies View Related

How To Install SQL Server 2005 Express Downloaded With VS 2008 Express

May 7, 2008

Downloading and installing VS 2008 Express also created a Miscrosoft SQL Server folder.  How do I install the SQL Server 2005 Express?The following is what I found from the HELP menu bar of the VS 2008 Express.  Where can I find the sqlexpr.exe?
TIA,Jeffrey 
 
To install SQL Server Express To begin installation, double-click sqlexpr.exe. Note: SQL Server Express is available as a self-extracting executable file (sqlexpr.exe) from both the Visual Studio 2005 CD and the SQL Server Express Web site. SQLEXPR.EXE installs on x86-based computers and to the 32-bit subsystem (WOW64). For more information, see Hardware and Software Requirements (SQL Server Express)

View 1 Replies View Related

Can't Connect To SQL 2005 Express With SQL Server Management Studio Express

Mar 10, 2006

I've seen the following error posted when people try to connect to their server via their applications but didn't see anyone having problems when trying to connect with SQL Server Management Studio Express. Am I missing something here? This is the 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)(Microsoft SQL Server, Error: 2)>>The server is not remote so I don't see why I need to enable remote connection. I am also using the default connection settings.

View 3 Replies View Related

MS SQL Server Management Studio Express (2005) Express Edition

Jan 8, 2008

Hello,

I am trying to "import" a .dbf into SQL Server Compact Edition, but I cannot find a way to do so. Can someone tell me how this is done?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved