Archive for the ‘DotNet’ Category

Install Red5 on Windows 7 (64-bit)

Install Red5 on Windows 7 (64-bit)

We will install Red5-0.9.1 on Windows 7 (64-bit). We will also install some required features for further development and use.
Those are :
Java Development Kit v.1.6
apache-ant v.1.7
eclipse-galilleo-SR1-win32

1. Download and Install the 32-bit version of the JDK 6 (jdk-6u29-windows-i586.exe).
Copy the ….\Java\jdk1.6.0_29\bin\java.exe  and paste it in …..C:\Windows\SysWOW64.
We need this specific java version because Red5 version 0.9 is compatible with Java Version 1.6 & eclipse galileo is compatible with the 32-bit version of JDK.

2. Download apache-ant version 1.7(apache-ant-1.7.1-bin.zip) from http://archive.apache.org/dist/ant/binaries/.
NOT version 1.8 because it creates some kind of problem with the javac.
So download the apache-ant-1.7.1-bin.zip file and extract it on your Hard Disk. I put it in C:/Program Files (x86)/Java to keep it all together.
Rename the extracted folder to Ant.

3. Download and Install Red5-0.9.1 for windows, from http://trac.red5.org/wiki/0_9_1 .
Change the install directory to C:/Red5.
Enter IP Adress : 127.0.0.1 (for local install).
Enter Port Number : 5080.

4. Download eclipse-galileo-SR1.win32.zip from http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/galileosr1 .
Extract the folder eclipse somewhere on your Hard Disk. I put it in C:\eclipse.
No need to install, to run just double click the eclipse.exe.

5. IMPORTANT: Enviromental Variables
To set the Enviromental Variables, go to control panel -> system -> Advanced system settings -> Enviroment Variables.
Select Path->edit and add the ANT path. example : …..;C:\Program Files (x86)\Java\Ant\bin;….
Select Path->edit and add the JDK path. example : …;C:\Program Files (x86)\Java\jdk1.6.0_29\bin;..
Select New and add name: ANT_HOME . value the Ant path for example C:\Program Files (x86)\Java\Ant
Select New and add name: JAVA_HOME , value: the jdk path for example C:\Program Files (x86)\Java\jdk1.6.0_29
Select New and add name: JAVA_VERSION , value: 1.6
Select New and add name: RED5_HOME , value: C:\Red5

6. To start Red5 run red5.bat and to stop run red5-shutdown.bat. It’s better to use the red5-shutdown.bat to close it, to avoid malfunction.
On your browser type “localhost:5080” to start using Red5.
Choose “Install a ready made application”. Install everything except audiotranscoder and videotranscoder. They require to install xuggle first. (but xuggle is not compatible with windows 7 64-bit, so we won’t be able to install any application that requires xuggle).
Choose “Launch a demo to use an installed application.

What is and how to install Red5 in Windows

What is and how to install Red5 in Windows?

I started looking at Red5 these days and decided to write a post about it.

What is Red5?

Many years ago Adobe (legacy Macromedia) created a software called Flash Communication Server. This was a media server that allowed users to transfer real-time data, audio and video to create multi-user applications. Adobe changed its name to Flash Media Server or FMS. To send data it uses a protocol called RTMP (Real Time Messaging Protocol) and a data format known as AMF (ActionScript Message Format).

The license is pretty expensive. The cheapest one is about 999 USD and the most expensive one 4500 USD (or more) and not so many people and/or small companies have this amount of money for a single software.

A cheaper alternative is SmartFox Server that is very similar to Flash Media Server and manages prices between 500 a 2000 euros. This server is better for MMO games and supports connections not only from Flash but also from Unity, Silverlight, .net, Java, Android and iPhone. You can also buy an isometric game engine called OpenSpace by paying 2200 euros more. It keeps being expensive though.

A better approach is using Red5 which is a Flash Media Server clone, with the difference this is open-source and free. The only problem is its lack of documentation and that its installation is not as straightforward as FMS. I’ll explain the installation process in Windows below.

Installing Red5

This process describes how to install Red5 version 0.9.1.

Download: Lets download the installer from http://code.google.com/p/red5/. Select the download depending on your operating system.

Install JDK: If you do not have Java installed, download the latest version from http://java.sun.com/javase/downloads/index.jsp. Download the right version for your 32 or 64 bits operating system.

Set the environment variables in Windows: You have to create a JAVA_HOME environment variable so that other applications and Red5 know where to find Java.

In Windows XP you have to right-click “My Computer” and select “Computer” properties, and then click the “Advanced” tab. In Windows Vista or 7 you have to right-click on “Computer” and select “Properties”, then click Advanced System Settings and the “Advanced” tab.

Click on Environment Variables. In “System Variables”, click the “New” button and type JAVA_HOME in the “Variable Name” box and the path were JDK installed in the “Variable Value” box. Let’s say you installed it in C:Program FilesJavajre1.6.0_23, it all depends on the version and settings you chose when installing.

There is an extra step for 64-bits versions of Windows. When you install Java, some files are copied to the C:WindowsSystem32 folder, but you also need to copy them in the C:WindowsSysWow64 folder. In this case you only need to copy the C:Program FilesJavajdk1.6.0_23binjava.exe file to C:WindowsSysWow64.

Installing RED5: Execute the Red5 installer (setup-Red5-0.9.1.exe). By default you install it in C:Program FilesRed5 or C:Program Files (x86)Red5 for 64 bits systems. When you are prompted for an IP address type 127.0.0.1. When prompted for a port type 5080.

Start the RED5 server: Open up the “Control Panel” and select Administrative Tools and then Services. In the list of services look for RED5. Select it and start the services by clicking the “Start service” link or by right clicking the service and selecting Start. If start is not enabled then the service is already running.

Testing RED5: To test RED5 open this URL in a browser http://localhost:5080/. The RED5 home page must open and if it does everything installed correctly. Before running the examples you must install them first. Open the following URL http://localhost:5080/installer/ select the example you want to install and press Install (install SOSample for example). Then from the Red5 home page (http://localhost:5080/) click “Launch a demo” to see the list of demos. We can now open the Shared Ball demo in many browser windows and click the connect icon on each of them to connect the samples to the server. Then if you drag the Red5 logo, you’ll see how it moves in the other browser windows as well.

And now what?

If you wish to see the source code, the server code is located inside the Red5 installation folder C:Program FilesRed5webapps or C:Program Files (x86)Red5webapps for 64 bits systems. To get the client Flash code you can use TortoiseSVN or any other subversion client to get them from http://red5.googlecode.com/svn/flash/trunk (Flash samples) or http://red5.googlecode.com/svn/flex/trunk (Flex samples). The Flash samples were written in ActionScript 2.0, so you’ll have to translate them to ActionScript 3.0 but this is not complicated.

If you don’t want to translate code you can write your own. To connect to Red5 you use the NetConnection class, to exchange data you use RSOs (Remote Shared Objects) and to send and receive audio/video use the NetStream class. To create en RSO just use the following line of code:

var rso:SharedObject = SharedObject.getRemote(
"NombreRSO", "rtmp://localhost/NombreApp");

You just have to play a little and see the samples to get the rest done.

Making Database Connections to Remote SQL Server 2008 using Oracle SQL Developer

Making Database Connections

Connect to Oracle and third-party databases from Oracle SQL Developer.

Oracle SQL Developer enables developers and DBAs to browse, create, and update data in a database. Before you can perform those actions, however, you must create at least one database connection —an Oracle SQL Developer object containing the information needed to connect to a specific database as a specific user.

This column explains how to make connections from Oracle SQL Developer to an Oracle Database and third-party databases. It also discusses authorization options for Oracle Database connections and explains the role of JDBC drivers in the connection process.

All the examples in this column require Oracle SQL Developer to be running on your local machine. For some examples, you need access to a running local or remote Oracle Database instance with the sample HR schema (available in the default database installation). Other examples require access to an Oracle Internet Directory server or a third-party database.

Basic Connections

You can connect to a local or remote Oracle Database instance by using the Basic connection type. Basic connections do not require any other Oracle software to be installed on your machine—you don’t need an Oracle home.

Right-click the Connections node in Oracle SQL Developer’s Connections Navigator, and click New Connection to open the New / Select Database Connection dialog box. All of this column’s connection examples start from this dialog box.

To create a basic connection for the HR schema, follow these steps:

1. Enter HR_ORCL for Connection Name . The connection name is an arbitrary alias; conventionally, it’s a combined username and database name.

2. Enter hr for Username , and enter the hr password in the Password field. (If you check the Save Password box, the password will be stored as an encrypted file on your local machine.)

3. Select Basic from the Connection Type list.

4. Provide information for the following settings:

  • Role: This is the set of privileges to be associated with the connection. Accept default for this connection.
  • OS Authentication: Leave this unchecked for this connection.
  • Proxy Connection: Leave this unchecked for this connection.
  • Hostname: This is the host system for the Oracle Database instance. Enter an IP address, a machine name, or localhost (when connecting to a database on the same machine as Oracle SQL Developer). The default is localhost .
  • Port: This is the listener port for the database. The default port for Oracle Database is 1521.
  • SID: This is the system identifier, such as orcl (the default for Oracle Database 10g and Oracle Database 11g) or xe (the default for Oracle Database 10g Express Edition).
  • Service name: This is the network service name of the database. Select either SID or Service name.

5. Click Test to validate the new connection. Figure 1 shows the dialog box after the connection has validated successfully.

6. If your test reports “Status: Success,” click Connect . Oracle SQL Developer will save the new connection, close the dialog box, and connect to the database. (If you click Save instead of Connect , you will be able to create more new connections in the dialog box before connecting.)

Now HR_ORCL appears in Connections Navigator, and you can expand it to browse the database.

TNS Connections

The TNS connection type is an appropriate option in any of the following circumstances:

You have an Oracle client installed on your machine. You have access to many Oracle Database instances. You do not know the machine details of the system hosting the Oracle Database instance you want to connect to.
A TNS connection uses an alias entry from a tnsnames.ora file. Oracle SQL Developer uses only one tnsnames.ora file. You may have more than one on your local machine or want to use the tnsnames.ora file on a remote machine, so note that Oracle SQL Developer looks sequentially for the tnsnames.ora file in the following locations:

1. $HOME/.tnsnames.ora
2. $TNS_ADMIN/tnsnames.ora
3. /etc/tnsnames.ora (non-Windows systems)
4. $ORACLE_HOME/network/admin/tnsnames.ora
5. Registry key

On Windows systems, if a tnsnames .ora file exists but Oracle SQL Developer isn’t using it, create a TNS_ADMIN environment variable via Control Panel -> System -> Advanced -> Environment Variables , specifying the file’s location as the variable’s value.

Follow these steps to create a TNS connection in Oracle SQL Developer:

1. In the New / Select Database Connection dialog box, enter the same connection name, username, and password you used for the basic connection.

2. Select TNS from the Connection Type list. The GUI changes slightly to provide a list of all network alias entries available to you. Select an alias.

3. Click Test and Connect as before.

LDAP Connections

Oracle Internet Directory is a directory service that enables you to store and manage network service names centrally. With it, user identity information can be stored in a directory instead of in multiple databases. Oracle Internet Directory is an implementation of the LDAP directory service and a component of Oracle Identity Management. For information on how to install, set up, and configure Oracle Internet Directory, see the Oracle Internet Directory Administrator’s Guide.

To look up database services in Oracle Internet Directory and create an LDAP connection in Oracle SQL Developer, follow these steps:

1. In the New / Select Database Connection dialog box, enter a new connection name, username, and password for the database user.

2. Select LDAP from the Connection Type list.

3. Select a server from the LDAP Server list, which is populated with entries from an ldap.ora file (similar to the tnsnames.ora file). Alternatively, you can enter LDAP server details directly.

4. Fill in the LDAP Admin User and LDAP Admin Password fields.

5. Click Load to populate the DB Service list with all the database service entries from Oracle Internet Directory.

6. Select a service from the DB Service list, as shown in Figure 2.

7. Click Test and Connect as before.

Other Authentication Options

Alternatives to database authentication and LDAP authentication include operating system (OS) and proxy authentication. You can create connections in Oracle SQL Developer for users who authenticate with these mechanisms. OS authentication. With OS authentication, Oracle Database uses a database user’s OS login credentials to authenticate that user. The user doesn’t provide a username or password to access the database, and Oracle Database doesn’t store and manage the account password. Local OS authentication can be used when the client and the database server are on the same machine. Remote OS authentication is possible but is not considered secure.

To configure local OS authentication for a new user, first find the value of the OS_AUTHENT_PREFIX database initialization parameter in your system’s init.ora file. When you create this new user in the database, you must add this parameter value as a prefix to the OS username. The default value is OPS$, for backward compatibility with earlier database releases. (If the value is “”, the OS username and the database username are the same, so you don’t need to add a prefix to create the Oracle usernames.)

Establish a basic connection with the HR schema as the SYSTEM user. Execute the following from the SQL worksheet, using your database’s OS_AUTHENT_PREFIX prefix and substituting your own OS username for “sue”:

CREATE USER ops$sue IDENTIFIED EXTERNALLY;
GRANT Connect, resource to sue;

Now create a basic connection for this user from the New / Select Database Connection dialog box. Enter a connection name; select Basic for Connection Type ; fill in the Hostname and Port fields; select OS Authentication ; and provide a SID or Service name . Click Test and Connect as before.

Proxy authentication. Proxy authentication means that one JDBC connection acts as a proxy for other JDBC connections. Before you can create a connection that uses proxy authentication, you need a proxy user. In the following example, you create a new user named HR_PROXY_USER and connect that user through the existing HR user.

To create the new proxy user (HR_PROXY_USER) and grant the correct proxy authentication privileges, execute the following in the SQL worksheet:

CREATE USER HR_proxy_user IDENTIFIED BY <
                               password>;
ALTER USER HR_proxy_user GRANT CONNECT THROUGH HR AUTHENTICATED USING PASSWORD;

You also need to grant any other privileges required by the new user, such as CREATE SESSION.

Once your proxy user exists, you can create a new proxy connection for HR in Oracle SQL Developer. Select Proxy Connection in the New / Select Database Connection dialog box, and complete the details in the Oracle Proxy Connection dialog box, as shown in Figure 3.

Connecting to Third-Party Databases

Oracle SQL Developer supports browsing and reviewing data and objects in Microsoft Access, MySQL, Microsoft SQL Server, and Sybase. It also offers a SQL worksheet for ANSI SQL commands to update or create objects for these databases. Users who want to migrate from third-party databases to Oracle Database can use the Oracle SQL Developer Migration Workbench. For any of these situations, you need to create a connection to your third-party database.

Installing third-party drivers. The correct third-party driver must be installed before you can create the connection. You can install third-party drivers either manually or by using Check for Updates ( Help->Check for Updates ). For manual installation, you can download supported drivers from the following locations:

  • MySQL JDBC driver, version 5.08: dev.mysql.com/downloads/connector/j/5.0.html.
  • jTDS driver, version 1.2 (required by Microsoft SQL Server and Sybase): source forge.net/project/showfiles.php?group_id=33291. (See jtds.sourceforge.net for information about this driver.)

Microsoft Access does not require an additional driver, because it uses a JDBC/ODBC bridge.

After downloading the driver you need, expand the driver binary Java Archive (JAR) file, which is typically inside the downloaded archive file:

  • The mysql-connector-java-5.0.8.tar.gz (or .zip) download for MySQL includes mysql-connector-java-5.0.8-bin.jar.
  • The jtds-1.2-dist.zip file for Microsoft SQL Server and Sybase includes jtds-1.2.jar.

Select Tools -> Preferences -> Database -> Third Party JDBC Drivers . Click Add Entry , and add your specific JAR file. Now you can create a connection for your third-party database.

Creating a Microsoft Access connection. To create a connection for Microsoft Access, follow these steps in the New / Select Database Connection dialog box:

1. Enter a connection name.
2. Click the Access tab.
3. Click Browse to locate the .mdb file you want to work with.
4. Click Connect.

You can now expand and browse the new Microsoft Access connection in the Connections Navigator.

Creating a Microsoft SQL Server, Sybase, or MySQL connection. To create a connection to a Microsoft SQL Server, Sybase, or MySQL database in the New / Select Database Connection dialog box, follow these steps:

1. Enter a connection name, username, and password.
2. Click the SQL Server, Sybase , or MySQL tab. Figure 4 shows the SQL Server tab.

figure 1
Figure 1: Basic database connection type
figure 2
Figure 2: LDAP connection with a list of database services
figure 3
Figure 3: Creating a proxy connection
figure 43
Figure 4: Connecting to Microsoft SQL Server

3. Choose one of the password authentication options (each of these connections offers you multiple choices).
4. Fill in the Hostname and Port fields. The default port is 1433 for Microsoft SQL Server, 5000 for Sybase, and 3306 for MySQL.
5. Click Choose database to populate the database list, and select the appropriate database from the list.
6. Click Test and Connect as before.
You can now browse your Microsoft SQL Server, Sybase, or MySQL database in the Connections Navigator.

Conclusion

Oracle SQL Developer provides an array of alternatives for connecting to Oracle and third-party databases. Support for both Oracle JDBC Type IV (thin) and Type II (thick) drivers lets you access Oracle Databases via basic, TNS, or LDAP connection types. You can make connections for Oracle Database users who authenticate via database, OS, or proxy authentication. Connecting to a third-party database from Oracle SQL Developer lets you work in that database and gives you a starting point for migrating to Oracle Database.

Using Oracle SQLDeveloper to access SQLServer

Using Oracle SQLDeveloper to access SQLServer

It is a pretty cool feature to use Oracle’s SQLDeveper 1.1 to access SQLServer.
The steps are:

  • Download jTDS (open-source SQLServer JDBC driver) from here. Unzip and extract the jtds-1.2.jar or whatever the latest version.
  • Start Oracle’s SQLDeveloper, Tools->Preferences->Database->Third Party JDBC Drivers. Click “Add Entry” and point to the jtds-1.2.jar
  • Create a new connection, choose SQLServer tab, type in hostname, port, username and password. It appears that the initial connection name has to be the same as the database and you can click the “Retrieve database” button. Once you found the database, you can rename the connection.

Try it out.
Of course, certain things don’t work. Like explain plan and auto trace.

Per comments below, please make sure jtds 1.2 is used. Apparently, 1.3 does not work.

Using *googlechrome for running the Selenium RC Automation Tests on Google Chrome Browser

Using *googlechrome for running the Selenium RC Automation Tests on Google Chrome Browser

*googlechrome is used to run the Selenium RC Automation Tests on Google Chrome Browser.

Lets Implement This:

1. Replace *firefox with *googlechrome in the project explained in our previous post as shown below:

2. Start the Selenium Standalone Server
3. Save and Run the ‘Class15.java’ file by selecting the ‘JUnit Test’ option and ensure that Selenium RC Automation Test is Run in Chrome Browser as shown below:

Watch the below video:

Click here to watch the video.

Download this Project:

Click here to download this project and import into Eclipse IDE  on your machine.

Deploying a SQL Database to a Remote Hosting Environment (Part 1)

Solution: Deploying a SQL Database to a Remote Hosting Environment

Scenario:

You finish building a great ASP.NET application, have everything tested and working right on your local system, are taking full advantage of the new ASP.NET 2.0 Membership, Role and Profile features, and are ready to publish it to a remote hosting environment and share it with the world.

Copying the .aspx files and compiled assemblies to the remote system is pretty easy (just FTP or copy them up).  The challenge that confronts a lot of developers, though, is how to setup and recreate the database contents – both schema and data – on the remote hosted site.  Unfortunately there hasn’t historically been a super-easy way to accomplish this.

The good news is that the SQL Server team published the release candidate of a new SQL Server Hosting Toolkit that will make it much, much easier to deploy your SQL solutions remotely to a hosted environment.  The toolkit allows you to work with SQL Express, SQL Server 2000, and SQL Server 2005 databases locally, and then easily transfer your schema and data and install them into a shared hosting remote SQL Server account.

The below post describes how you can start using this today.

SQL Server Hosting Toolkit

The SQL Server Hosting toolkit is available for free, and ships with a Database Publishing Wizard that supports two database hosting deployment scenarios:

1) The Database Publishing Wizard enables you to point at a database you are working with on your local system, and then automatically create a .SQL script file that contains the setup logic needed to re-create an exact replica of the database on any remote system.  This .SQL script includes everything needed to create the database schema (tables, views, sprocs, triggers, full-text catalogs, roles, rules, etc – full details here), as well as populate the new database with the same table row contents as your local database (this is analogous to the MySQL dump utility).  The benefit of having this setup logic encapsulated in a single .SQL file is that most hosters already support the ability for you to upload .SQL files to their hosted environments and run these scripts via their hosting admin control panels.  Assuming you have a web hoster that supports this today, you can immediately start using the Database Publishing Wizard to easily deploy your sites without requiring anything to be installed or configured by the hoster.

2) The Database Publishing Wizard also enables you to point at a database you are working with on your local system, and then use web-services to transfer and recreate the database in your remote hoster environment (without you having to create the .SQL file or use the hoster admin control panel to run it).  This publishing option does require that a SQL Publishing web-service be exposed in the hosting environment, and the SQL Server Hosting Toolkit includes a free implementation of this SQL Publishing web-service that we’ll be working with hosters to aggressively deploy.

The Database Publishing Wizard enables you to use either SQL Express or SQL Server 2000/2005 locally, and then use either SQL 2000 or SQL 2005 in the remote hoster environment.  It does not require that the versions of SQL match – so you can use SQL Express 2005 locally and then upload to a SQL 2000 server in the hosting environment without having to change any of your code.

The Database Publishing Wizard also supports handling the built-in ASP.NET 2.0 Membership, Role Management, Profile and Health Monitoring schemas.  A lot of people have run into issues because the built-in .SQL scripts that ship by default with ASP.NET for setting up these schemas require DBO permissions at install-time for the SQL scripts — which a lot of hosters don’t support (note: the scripts do not require DBO permissions at runtime – only for install time, but this can sometimes still be a blocker in itself unless the hoster is willing to install them for you).  The Database Publishing Wizard on the other-hand does not require DBO permissions when installing the ASP.NET Membership, Roles and Profile schemas/data, and should enable you to deploy the ASPNETDB tables + sprocs just as easily as any other database using the Database Publishing Wizard.

First Tutorial: Deploying a SQL Express Database to a SQL Server Hosting Account (using .SQL files)

I’ll be doing a series of posts over the next few weeks showing how to use the various features within the SQL Server Hosting Toolkit.  This first tutorial in the series covers how to use it to easily generate a .SQL installation file of a local SQL Express database that you can then copy to a remote hosting account and use to re-create a SQL Server database for you to use with your hosted site.

Step 0: Download and Install the Database Publishing Wizard

The first step we’ll need to-do is to make sure we have the Database Publishing Wizard from the SQL Hosting Toolkit installed.  Click here to download it and install it.

The Database Publishing Wizard comes with support for both a GUI based wizard, as well as a command-line utility.  The GUI based wizard can be run either standalone or via context-menu support that it adds to the Server Explorer in both Visual Studio 2005 and Visual Web Developer Express.  For the purposes of this tutorial we’ll be using this later Server Explorer integration – which makes publishing really easy.

Step 1: Create an ASP.NET web-site that uses a local SQL Express or SQL Server database

To help with this demo, we will use the built-in Personal Starter Kit template that ships with both VS 2005 and Visual Web Developer Express.  To create a new web project based on it, select File->New Web Site within VWD or VS and choose the “Personal Starter Kit” template in the New Web-Site dialog.  By default the personal starter kit application is configured to use SQL Express (which is free and can be downloaded here).  When run the sample looks like below:

After creating the application, you can then run the web admin tool (choose the WebSite->ASP.NET Configuration menu item in VWD/VS) and create a new user and add them to the “admin” role for the site.  You can then login as this new admin user and try uploading new pictures and/or customizing the existing ones on the site (note that both the picture meta-data, as well as the raw image binaries are stored in a database when you do this):

Once you are all done with the above steps we’ll have two SQL Express databases installed within the \app_data directory for our project.  One of the SQL Express databases is named personal.mdf and contains the tables and stored procedures specific to our web-site (photo and album tables, as well as basic content management support).  The other SQL Express database is named aspnetdb.mdf and contains the database storage for the default ASP.NET 2.0 Membership, Role and Profile providers (which the application above is using for login and admin purposes).

Step 2: Creating .SQL Installation Scripts for our Database

Now that we’ve created a new application + local database, and added custom data to it (new users + their role membership, as well as new photos and albums), we want to deploy the application to a remote hosting server.

The first step we’ll take is to create .SQL script files that will enable us to automate re-creating the exact same database schema + database content on our remote hosting account.  To-do this we’ll use the Database Publishing Wizard we installed as part of the SQL Hosting Toolkit.

To begin, click on the “Server Explorer” tab within Visual Studio or Visual Web Developer to see the databases that the application is using:

As you can see in the above picture, we have two SQL Express databases that we are using: ASPNETDB.MDF and Personal.MDF.  To generate .SQL installation files for each one, simply select the database in the solution explorer, then right-click and select the new “Publish to Provider” context menu item (added by the Database Publishing Wizard) setup on it:

This will launch the Database Publishing Wizard and allow us to walkthrough scripting the installation of our database.  As I mentioned in the intro of this blog post, the Database Publishing Wizard supports two deployment options: 1) To generate .SQL install script files that you can copy to your remote hoster and run using their existing web admin control panel tools, or 2) To upload the database directly using Database Publishing Web-Services on the hoster web-site.

For this first tutorial, we’ll be using the .SQL script file approach – so keep the default radio button selected and provide a name for the .SQL install script file you want to generate:

When you click “next” you’ll be given the option to customize some of preferences when creating the .SQL setup file.  Note that you can control whether to drop existing objects within the target database, whether you want to target SQL 2000 or SQL 2005 with the script, and whether you want to setup both the schema and data, or just the schema, or just the data:

For this tutorial just keep the defaults selected, and hit next and generate the .SQL script:

You now have a Personal .SQL file that contains a script that you can run on any SQL server to re-create all the tables, sprocs, views, triggers, full-text catalogs, etc. for a database, as well as import and add all of the table row data that was in the database at the time the .SQL file was created.

The .SQL file itself is just plain text – so you can open it up with any text editor to see it and/or customize it with your own statements:

Notice above how the .SQL file includes both the SQL DDL needed to create the Photos table (including all of its constraints and primary-key/foreign-key relationships), as well as the SQL to insert data within the table once it is created (in the case above it is even inserting binary data for the photos – since they are stored in the database).

Once you repeat these steps for the ASPNETDB SQL Express database as well you’ll have two .SQL installation scripts that you can use to automatically re-create your SQL database on any SQL Server:

Note that the .SQL files we built can be used to create two separate databases on a server, or they can both be run against the same database to create a single database that has a unified set of tables, sprocs, and data for the application.  To accomplish this, simply run both scripts against the same database, and assuming no table or sproc names conflict, you’ll have a single database containing everything.  This later option is very useful when you have a hosting account that only provides 1 database instance for you to use!

Step 3: Using our .SQL files to create our remote databases

Now that we have our .SQL files, we can go about using them to install our database at our hoster.  Exactly how we use the .SQL files to install the database will vary depending on how the hoster gives us access to our SQL account.  Some hosters provide an HTML based file-upload tool that allows you to provide a .SQL file – which they will then execute against the SQL database you own.

Other hosters provide an online query tool (like below) that allows you to copy/paste SQL statements to run against your database.  If you have a hoster which provides an online query tool like this, then you can open the .SQL file with a text-editor and copy/paste the contents into the query textbox and run it.

The quality of the SQL tools that different hosters provide varies quite a bit.  In testing the Database Publishing Wizard we found that some custom-made SQL admin tools provided by hosters had issues where they incorrectly parsed valid SQL statements (in particular GOTO statements).  This page describes one issue you might see some hosters have with GOTO statements, along with a workaround you can use.  To help improve the overall quality of SQL hosting admin tools, the SQL Server team early next year is going to be shipping the source to a free SQL HTML admin tool that hosters will be able to integrate into their experiences.  Hopefully this will help improve the standard experience with all Windows hosters.

If your hoster has no usable HTML web admin tool for allowing you to easily manage your SQL database, then you can also just write a simple ASP.NET page that you FTP (along with your .SQL file) to your web-site and then hit to read the .SQL file on the server in as text, and then pass it as a string to ADO.NET to execute.  This will give you the same result as the query analyzer above – and fully create your database for you.

Step 4: Updating our connection-string within web.config

Once we’ve got our data uploaded within a database at our hoster, we’ll want to upload our .aspx files, assemblies and content to the remote site (typically this is done over FTP).

The last step we’ll need to take is to open up our web.config file and update the <connectionStrings> section to point at our new database location at the remote hoster.  Note that you’ll need to get the exact SQL server, database name, and username/password account to use from the hoster.

Using our personal starter kit example above, we’d change the <connectionStrings> section within its web.config file from the default connection-string (which uses two SQL Express database in the local \app_data directory):

<connectionStrings>

 <add name=”Personal” connectionString=”Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf” />
<
remove name=”LocalSqlServer”/>
<
add name=”LocalSqlServer” connectionString=”Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf” />
</
connectionStrings>

To instead use a single SQL Server 2000 database (the “scottguDB” database on the “Server123” box).

<connectionStrings>
<add name=”Personal” connectionString=”Data Source=Server123;Initial Catalog=scottguDB;Integrated Security=True” providerName=”System.Data.SqlClient” />
<
remove name=”LocalSqlServer”/>
<
add name=”LocalSqlServer” connectionString=”Data Source=Server123;Initial Catalog=scottguDB;Integrated Security=True” providerName=”System.Data.SqlClient” />
</
connectionStrings>

We were able to use a single database (instead of the two above) because we we ran both .SQL files against the single database – which merged all schema and data into a single database instance.

Step 5: We are done

Now we can run the application remotely in a hosted environment, and it should just work.

Summary

The Database Publishing Wizard that ships as part of the SQL Hosting Toolkit should make creating .SQL files for any database (SQL Express or full SQL Server) really easy.  You can use this to easily dump your local database and then use it to re-create the exact same database on a remote system.

In future tutorials I’ll also show how you can actually re-create your database remotely without even having to generate a .SQL file (instead you can publish the database directly from VS to your hoster over a web-service).  Stay tuned for details on how to-do this soon.

Hope this helps,

Best 25 Free Online Fax Services

It can be quite expensive to keep separate and dedicated Fax machines for different sections of big offices. Every department want privacy of data and want to shed the dependence on one particular fax machine.

But on the other hand, when many employees are at freedom of working from home and others are traveling continuously to every corner of world, keeping Fax machines at every place is next to impossible. Many of you don’t know that we can look up to online fax service in such a right spot.

Although most of these online fax services are not free to use but you can always opt for the trial version before actually buying the paid version. Today we have collected 25 Best Free Online Fax Services which will give you a whole bunch of happiness. You will no more be on the mercy of the Fax machine being kept on the reception area of your office. These Online Fax Services send Fax to you in form of emails so you can check the fax at your ease. Please have a look at below mentioned 25 Best Free Online Fax Services (Trial Versions) and make your life simple and better.

If you like this article, you might be interested in check the collection of website for Free Stock Photos,Make a Cartoon of Yourself, Finding a Perfect Domain Name, Download Free Fonts, Have Fun With Your Pics, Free Textures, and Getting Free Vector Art Images.

eFax

Send & receive faxes by email and you will also get a local fax number. You can check it with a 30 day trial offer.

eFax

More Information on eFax

K7

Its a web-based unified messaging system that channels your free voicemail and fax messages directly to your e-mail. K7 Unified Messaging provides you with a free phone number.

K7

More Information on K7

faxZERO

In its free version, you will have an Ad on the cover page,you can Fax 1 document — max 3 pages and Max 2 free faxes on per day basis

faxZERO

More Information on faxZERO

My1Voice

My1Voice is a virtual phoone. You can check a 30 day trial version and receive faxes from your my1voice number along with other features.

My1Voice

More Information on My1Voice

PamFax

With a trial version of PamFax, you can send some faxes for free. Iit supports many file formats in addition to PDF and DOC files.

PamFax

More Information on PamFax

ScanR

It’s a digital scanner and fax in your pocket! Your phone is suddenly a business center – scan, print and fax wherever you go. Scan documents to turn them into digital files you can store, share, and fax.

ScanR

More Information on ScanR

freefax

freefax

More Information on freefax

Interpage

This is a free service offered by Interpage to demonstrate and promote our fast, robust, and reliable email-to-fax and other fax delivery services. Using this service, you may send a fax for free to any US/Canada-based fax machine, for delivery to the destination fax which you specify

Interpage

More Information on Interpage

MaxEmail

Send & Receive Faxes Without Buying a Fax Machine or an Expensive Dedicated Phone Line

MaxEmail

More Information on MaxEmail

RapidFAX

RapidFAX combines the utility of fax with the ease of email to meet the needs of the small office and home office.

RapidFAX

More Information on RapidFAX

smartfax

Send fax from email to any fax number. Merge the convenience of email with fax.

smartfax

More Information on smartfax

TrustFax

With Trustfax, no Fax Machine or Phone Line Required and you get a Toll-Free and Local Fax Number.

TrustFax

More Information on TrustFax

VIF Internet

ervice limited to sending free faxes to the city of Montreal, Canada.

VIF Inter

More Information on VIF Internet

Metro Fax

With metro fax you can send high quality faxes from anywhere in the world using your web browser, no need for a fax machine, to a wide range of locations.

Metro Fax

More Information on Metro Fax

PopFax

You will get an account to send and receive fax, with a local fax number you can choose from over 500 cities in 20 countries. What more you can even go for a mobile fax service.

PopFax

More Information on PopFax

FaxFreedom

Fax machines are expensive and take up too much room. With FaxFreedom you can now simply send and receive faxes from any computer.

FaxFreedom

More Information on FaxFreedom

nextiva

With Nextiva vFAX all you need is an Internet connection in order to send and receive faxes. Our online fax service is easy to use, affordable and gives you great flexibility.

nextiva

More Information on nextiva

MyFax

MyFax is a fax service that lets you send and receive faxes through your email, the web, or smart phone.

MyFax

More Information on MyFax

Wonderfax

WonderFax is a free UK fax number that pick up your fax, converts them to a pdf file and emails it back to you as an attachment. So there is no need for fax lines or fax machines.

Wonderfax

More Information on Wonderfax

FaxOrama

FaxOrama supports multiple document formats like DOC, DOCX, RTF, GIF, JPG, JPEG, PDF, TIF, XLS, XLSX, TXT, PNG, BMP and WPS. You can also opt for a restricted sending option but an ad free free version.

FaxOrama

More Information on FaxOrama

Superfax

You can get a Fax Number in Paris, Los Angles or London for Free for a week. And See how it works.

Superfax

More Information on Superfax

MESSAGENET

It gives you 90 days trial period to check the service. You can both receive as well as send fax free till this time

MESSAGENET

More Information on MESSAGENET

GotFreeFax

It lets user send free fax online to the US and Canada without ads

GotFreeFax

More Information on GotFreeFax

that’s it.

%d bloggers like this: