Showing posts with label desktop. Show all posts
Showing posts with label desktop. Show all posts

Wednesday, March 7, 2012

BETWEEN LAPTOP AND DESKTOP

Hi,

I want to jumpstart my learning of SQL Server so I downloaded the Express edition onto my desktop in the office and also onto my laptop. I usually connect the two machines (through a LAN) to update whatever I was able to do at home while in the office.

What should I do in order to view or edit whatever I started on the laptop from the desktop? Would the databases I create on one be accessible through the other machine for editing and the likes?

Glint.

hi Glint,

you first need connectivity.. if that has to be performed at work, this is not a problem, as you just plug the office lan cable and you are on..

actually you do not need SQLExpress to be installed at all in the desktop pc as your "server" is located in the laptop.. so you just need to (remotely) connect from desktop (client) to the laptop (server)..

SQLExpress installs by default disabling network connections, so you need to run the Surface Area Configuration tool to enable "remote connections" and run SQL Server Configuration Manager to verify the desired network protocol is enabled..

you can then "connect" to your laptop server providing the appropriate credentials.. (by default SQLExpress installs allowing only WinNT authenticated connections, but you can modify that behaviour at "run time" to accept standard SQL Server authenticated connections (providing userid and password) modifying a Windows registry key,
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer
LoginMode = 2
where MSSQL.1 identifies your "engine number".. if you only installed 1 instance MSSQL.1 should be ok... or, you can download (recommended anyway) the SQL Server Management Studio Express, the "official" GUI based management tool for SQLExpress, from http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en, and connect via a trusted connection witl administrators permissions, select the server node, access it's properties and modify the "Server authentication" properties (Security tab) to "SQL Server and Windows Authentication mode"..

but this does not "copy or sync" your laptop "databases" to the office desktop.. if you need it to (copy), you have to "detach" the database you are interested wih, copy the relative physical files to the desktop, and attach the database there (see http://msdn2.microsoft.com/en-us/library/ms190794.aspx and http://msdn2.microsoft.com/en-us/library/ms187858.aspx for further info).. the very same task can be performed via a backup+restore action.. you backup a database (full backup) on the "server", copy the backup file to the destination machine, and restore there the database, http://msdn2.microsoft.com/zh-cn/library/9st0dc24.aspx

so you have the choice to "copy" your homework to the office pc, eventually work on it and finally re-copy all to the laptop for further homeworks, or just always connect to your laptop for office work as well..

please consider downloading Books On Line (BOL), the official and primary help resource for SQL Server at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx..

regards

|||Thanx, Andrea.

BETWEEN LAPTOP AND DESKTOP

Hi,

I want to jumpstart my learning of SQL Server so I downloaded the Express edition onto my desktop in the office and also onto my laptop. I usually connect the two machines (through a LAN) to update whatever I was able to do at home while in the office.

What should I do in order to view or edit whatever I started on the laptop from the desktop? Would the databases I create on one be accessible through the other machine for editing and the likes?

Glint.

hi Glint,

you first need connectivity.. if that has to be performed at work, this is not a problem, as you just plug the office lan cable and you are on..

actually you do not need SQLExpress to be installed at all in the desktop pc as your "server" is located in the laptop.. so you just need to (remotely) connect from desktop (client) to the laptop (server)..

SQLExpress installs by default disabling network connections, so you need to run the Surface Area Configuration tool to enable "remote connections" and run SQL Server Configuration Manager to verify the desired network protocol is enabled..

you can then "connect" to your laptop server providing the appropriate credentials.. (by default SQLExpress installs allowing only WinNT authenticated connections, but you can modify that behaviour at "run time" to accept standard SQL Server authenticated connections (providing userid and password) modifying a Windows registry key,
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer
LoginMode = 2
where MSSQL.1 identifies your "engine number".. if you only installed 1 instance MSSQL.1 should be ok... or, you can download (recommended anyway) the SQL Server Management Studio Express, the "official" GUI based management tool for SQLExpress, from http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en, and connect via a trusted connection witl administrators permissions, select the server node, access it's properties and modify the "Server authentication" properties (Security tab) to "SQL Server and Windows Authentication mode"..

but this does not "copy or sync" your laptop "databases" to the office desktop.. if you need it to (copy), you have to "detach" the database you are interested wih, copy the relative physical files to the desktop, and attach the database there (see http://msdn2.microsoft.com/en-us/library/ms190794.aspx and http://msdn2.microsoft.com/en-us/library/ms187858.aspx for further info).. the very same task can be performed via a backup+restore action.. you backup a database (full backup) on the "server", copy the backup file to the destination machine, and restore there the database, http://msdn2.microsoft.com/zh-cn/library/9st0dc24.aspx

so you have the choice to "copy" your homework to the office pc, eventually work on it and finally re-copy all to the laptop for further homeworks, or just always connect to your laptop for office work as well..

please consider downloading Books On Line (BOL), the official and primary help resource for SQL Server at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx..

regards

|||Thanx, Andrea.

Tuesday, February 14, 2012

Best way to launch report from a C# Winforms app?

I'm new to SSRS. I would like to launch a report from a C# desktop application, supplying parameters programatically. I was able to do this using System.Diagnostics.Process p ... then p.Start(@."(path)\iexplore.exe","(reportURL)"); I'm betting there's a much better way to do this.

Ideally I would like to create an IE window that shows only the report, that is, only the report viewer toolbar is visible, the IE toolbars and menus are hidden. I want to specify IE as the browser in case some other browser is installed as the default web browser.

Can anyone link me to a tutorial or provide a code snip? Thanks.Hi do not launch in IE. use ReportViewer Control to see that. You can add reports to your application by adding from Add Web Reference.|||Alas, it is at present still a .Net 1.1 application. I'll use ReportViewer when I upgrade it to .Net 2.0. In the meantime I'll launch IE to view the report. I tried to use SendKeys.Send to send F11 to get IE in fullscreen mode, but SetForegroundWindow did not work when given the Handle property of the process object returned by Process.Start.

Thanks for your response.

Sunday, February 12, 2012

Best way to copy a sql db between machines?

SQL server 2005 developer version

I have about a dozen db's scattered on 3 machines and want to
consolidate all of them on my desktop with the data intact.

What's the easiest, best way to accomplish this?

Can I backup on one and restore on another?

Yes you can RESTORE from one machine to another. You cannot combine databases via RESTORE, though. You would have 12 databases on one machine.

|||No, I do not want to consolidate them , just copy them from one machine to another so the data is the same everywhere.

I tried the restore and it errs out because the pc name is different
from the pc name of the db I backed up.

Seems rather limiting.

I also tried the export/import with flat file delimited but it errs out as well. I double checked the table entry details and the db's are identical. The target db is empty of data.

These are small db's but not so small I want to renter the data.

|||

Check out one of the RESTORE command options - [ WITH MOVE ...]

Refer to Books Online, Topic: RESTORE

|||I got the restore to finally work by creating the dir that it wanted.

My db's were in
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data

and sql server insisted upon :
C:\Program Files\Microsoft SQL Server\MSSQL\Data

Once I created that dir the restore worked just fine.

No where I could see to change the path for the restore either.
Pretty stupid if you ask me but that's what wizards are for.

Thanks for trying guys
|||A few days ago someone pinged me to do the same, this is what I sent him over:

-If you restore the files using the RESTORE DATABASE command, use with WITH MOVE options to place the files somewhere else on your computer. For more information about the WITH MOVE option, look in the BOL of SQL Server.

-Prefering the GUI to restore the files ? Then point to the backup device and navigate to the Options page within the restore dialog. Change the settings of Restore database files as (which actually means database files and logfiles) to point to the new directory. (It will contain by default the directories which were used during the backup process, by changing the directories within the dialog, it will create the script behind the scenes which uses the WITH MOVE option)

Jens k. Suessmeyer.

http://www.sqlserver005.de