Wednesday, February 21, 2007

how to Get version from Appication's assembly

U can get version of a application by coding .... just follow the steps...

1. include below namespace

Imports System.Deployment
Imports System.Reflection.Assembly

2. include the below code

Dim strVersion As String
Dim AssVersion As Version = GetExecutingAssembly.GetName.Version
strVersion = AssVersion.Major & "." & AssVersion.MajorRevision & "." & AssVersion.Minor
& "." & AssVersion.MinorRevision
lblVersionNo.Text = strVersion

Fetching Connctionstring From Web.config for DBClass

One of the Best Practise in website is Keeping Your Connection string in Web.config

1.Adding Connection string in Web.config

""appSettings""
""add key ="dbstring" value ="Connectionstring""
""appSettings ""

2.Adding the above connection string to Your DB Class

Imports System.Configuration

Imports System.Data.SqlClient

Public dbcon As New SqlConnection
dbcon.ConnectionString = ConfigurationManager.AppSettings("dbstring")

Tuesday, February 6, 2007

Creating Script File for Database & Tables

If a developed a Desktop Application in Dot.net & u want run this application in different M/c means Follow these steps .......


1.Create a SQL script file.
2.Copy the exe file to the target machine.
3.Execute the SQL script in the Query Window of the target machine.
4.Modify the connection string according to the target machine.