Neil - thanks for your reply. I used to code in avenue and left GIS for a while. Now I am back with .net background but clueless. Please help at your mercy. Or if you can point me to the documents that I've been looking for hours that would be great.
Try
If (Not ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Engine)) Then
If (Not ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop)) Then
Console.WriteLine("This application could not load the correct version of ArcGIS.")
End If
End If
Dim aoLicenseInitializer As LicenseInitializer
aoLicenseInitializer = New LicenseInitializer
'ESRI License Initializer generated code.
If (Not aoLicenseInitializer.InitializeApplication(New esriLicenseProductCode() {esriLicenseProductCode.esriLicenseProductCodeEngine, esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced}, _
New esriLicenseExtensionCode() {esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork})) Then
Console.WriteLine("This application could not initialize with the correct ArcGIS license and will shutdown. LicenseMessage: " + aoLicenseInitializer.LicenseMessage())
aoLicenseInitializer.ShutdownApplication()
Return
End If
Dim gp As Workspace = openSDEWorkspace("server", "sde:sqlserver:sqlserver", "username", "password", "sqldb", "dbo.Default")
Catch ex As ESRI.ArcGIS.RuntimeManagerException
Console.WriteLine(ex.ToString)
End Try
Console.Read()