Author Archive

Code Sign error: The identity ‘iPhone Distribution: doesn’t match any valid certificate/private key pair in the default keychain

I’ve experienced this error ‘Code Sign error: The identity ‘iPhone Distribution: ‘xxx’ doesn’t match any valid certificate/private key pair in the default keychain’ when deploying in Iphone device. Here’s how i’ve fixed the problem.

  1. Open XCode Project
  2. Go to Build Settings
  3. Find the Code Signing
  4. Under Code Signing Identity, There you find the default certificate that used by your Xcode, just change it to the correct certificate

No Comments


How to save UIImage to application document in IOS


Here’s a sample snippet on how to save image to application document.

  1. - (void)saveUIImage:(UIImage *)image withName:(NSString *)name {
  2. NSData *imgData = UIImageJPEGRepresentation(image, 1.0);
  3. NSFileManager *fileManager = [NSFileManager defaultManager];
  4. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,  YES);
  5. NSString *documentsDirectory = [paths objectAtIndex:0];
  6. NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:name];
  7. [fileManager createFileAtPath:fullPath contents:imgData attributes:nil];
  8.  
  9. }

, ,

No Comments


How to convert RGB Color to UIColor using NSScanner in IOS Programming

  1. - (UIColor *) colorForHex:(NSString *)hexColor {
  2.  hexColor = [[hexColor stringByTrimmingCharactersInSet:
  3.      [NSCharacterSet whitespaceAndNewlineCharacterSet]
  4.     ] uppercaseString];  
  5.  
  6.     // String should be 6 or 7 characters if it includes '#'  
  7.     if ([hexColor length] < 6)
  8.   return [UIColor blackColor];  
  9.  
  10.     // strip # if it appears  
  11.     if ([hexColor hasPrefix:@"#"])
  12.   hexColor = [cString substringFromIndex:1];  
  13.  
  14.     // if the value isn't 6 characters at this point return
  15.     // the color black
  16.     if ([hexColor length] != 6)
  17.   return [UIColor blackColor];  
  18.  
  19.     // Separate into r, g, b substrings  
  20.     NSRange range;  
  21.     range.location = 0;  
  22.     range.length = 2;
  23.  
  24.     NSString *rString = [hexColor substringWithRange:range];  
  25.  
  26.     range.location = 2;  
  27.     NSString *gString = [hexColor substringWithRange:range];  
  28.  
  29.     range.location = 4;  
  30.     NSString *bString = [hexColor substringWithRange:range];  
  31.  
  32.     // Scan values  
  33.     unsigned int r, g, b;  
  34.     [[NSScanner scannerWithString:rString] scanHexInt:&r];  
  35.     [[NSScanner scannerWithString:gString] scanHexInt:&g];  
  36.     [[NSScanner scannerWithString:bString] scanHexInt:&b];  
  37.  
  38.     return [UIColor colorWithRed:((float) r / 255.0f)  
  39.                            green:((float) g / 255.0f)  
  40.                             blue:((float) b / 255.0f)  
  41.                            alpha:1.0f];  
  42.  
  43. }

To use this method

  1. [self colorForHex:@"#FFCC88"];

, ,

No Comments


How to convert Hex color to UIColor using IOS Iphone

  1. + (UIColor* ) colorWithHex:(int)color {
  2.  
  3.     float red = (color & 0xff000000) >> 24;
  4.     float green = (color & 0x00ff0000) >> 16;
  5.     float blue = (color & 0x0000ff00) >> 8;
  6.     float alpha = (color & 0x000000ff);
  7.  
  8.     return [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:alpha/255.0];
  9. }
  10.  
  11. + (UIColor *) colorWithHexRed:(int)red green:(char)green blue:(char)blue alpha:(char)alpha {
  12.     int x = 0;
  13.     x |= (red & 0xff) << 24;
  14.     x |= (green & 0xff) << 16;
  15.     x |= (blue & 0xff) << 8;
  16.     x |= (alpha & 0xff);
  17.     return [UIColor colorWithHex:x];
  18. }

Sample on how to use the above method

  1. UIColor *redColor = [UIColor colorWithHex:0xff0000ff];

The 6 characters present the color in hex like you see in html and the remaining 2 characters are alpha.
Source

,

No Comments


How to add Done button in Iphone numeric keyboard using IOS


First add notification in viewDidLoad event

  1. [[NSNotificationCenter defaultCenter] addObserver:self
  2.                                              selector:@selector(addButtonToKeyboard)
  3.                                                  name:UIKeyboardDidShowNotification
  4.                                                object:nil];

Add the following method to handle creation of the button and adding it to the keyboard

  1. - (void)keyboardWillShow:(NSNotification *)note {
  2.     // if clause is just an additional precaution, you could also dismiss it
  3.     if ([[[UIDevice currentDevice] systemVersion] floatValue] &lt; 3.2) {
  4.         [self addButtonToKeyboard];
  5.     }
  6. }
  7.  
  8. - (void)keyboardDidShow:(NSNotification *)note {
  9.     // if clause is just an additional precaution, you could also dismiss it
  10.     if ([[[UIDevice currentDevice] systemVersion] floatValue] &gt;= 3.2) {
  11.         [self addButtonToKeyboard];
  12.     }
  13. }
  14. - (void)addButtonToKeyboard {
  15.     // create custom button
  16.     UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
  17.     doneButton.frame = CGRectMake(240,-40,80,40);//(0, 163, 106, 53);
  18.     doneButton.adjustsImageWhenHighlighted = NO;
  19.     if ([[[UIDevice currentDevice] systemVersion] floatValue] &gt;= 3.0) {
  20.         [doneButton setImage:[UIImage imageNamed:@"DoneUp3.png"] forState:UIControlStateNormal];
  21.         [doneButton setImage:[UIImage imageNamed:@"DoneDown3.png"] forState:UIControlStateHighlighted];
  22.     } else {        
  23.         [doneButton setImage:[UIImage imageNamed:@"DoneUp.png"] forState:UIControlStateNormal];
  24.         [doneButton setImage:[UIImage imageNamed:@"DoneDown.png"] forState:UIControlStateHighlighted];
  25.     }
  26.     [doneButton addTarget:self action:@selector(doneButton:) forControlEvents:UIControlEventTouchUpInside];
  27.     // locate keyboard view
  28.     UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];
  29.     UIView* keyboard;
  30.     for(int i=0; i&lt;[tempWindow.subviews count]; i++) {
  31.         keyboard = [tempWindow.subviews objectAtIndex:i];
  32.         // keyboard found, add the button
  33.         if ([[[UIDevice currentDevice] systemVersion] floatValue] &gt;= 3.2) {
  34.             if([[keyboard description]  hasPrefix:@"&lt;UIPeripheralHost"] == YES)
  35.  
  36.                 [keyboard addSubview:doneButton];
  37.         } else {
  38.             if([[keyboard description] hasPrefix:@"&lt;UIKeyboardTypeNumberPad"] == YES)
  39.  
  40.                 [keyboard addSubview:doneButton];
  41.         }
  42.  
  43.  
  44.     }
  45.  
  46. }
add this event on the textbox field

  1. - (void)doneButton:(id)sender {
  2.     [textField resignFirstResponder];
  3.  
  4.  
  5. }

, , ,

No Comments


How to trigger UIButton with UITapGestureRecognizer


To trigger UIButton touch action within a view that has a UITapGestureRecognizer, you have to implement the the UIGestureRecognizerDelegate protocol and its method -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch.


- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {


// test if our control subview is on-screen


if (self.controlSubview.superview != nil) {


if ([touch.view isDescendantOfView:self.controlSubview]) {


// we touched our control surface


return NO; // ignore the touch


}


}


return YES;


 


// handle the touch


 


}

or


- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {


if ([touch.view isKindOfClass:[UIButton class]]){


return FALSE;


}


return TRUE;


}


 


No Comments


How to detect if HTML document has fully initialized

Most programmers use the “onload” event to detect if the document has fully loaded, but there’s a flaws relying on this technique. The alternative of detecting is to check the DOM tree of the document.

For Firefox and Opera 9+, use “DOMContentLoaded

if ( document.addEventListener )

document.addEventListener(“DOMContentLoaded”, myFunction, false);

For Internet Explorer,

if  ( document.all && !window.opera ) { //

document.writer( ‘<script type=”text/javascript” id=”contentloadtag” defer=”defer” src=”javascript:void(0)”></script>’);

var contentloadtag = document.getElementById(“contentloadtag”);

contentloadtag.onreadystatechange = function() {

if ( this.readyState == “complete” ) [

myFunction();

}

}

}
Source

No Comments


ADO.Net Connection String


.NET Data Providers

Microsoft SQL Server

MySQL – From CoreLab

ODBC Providers

OLE DB Providers

Oracle Provider – From Microsoft

Oracle Provider
- From Oracle

Oracle Provider
- From CoreLab

Postgre SQL Direct
- From CoreLab

Sybase ASE

VistaDB Provider

Microsoft SQL Server .NET Data Provider (System.Data.SqlClient)

The Microsoft SQL Server .NET Data Provide allows you to connect to a Microsoft
SQL Server 7.0, 2000, and 2005 databases.

For Microsoft SQL Server 6.5 or earlier, use the OLE DB .NET Data Provider with
the SQL Server OLE DB
Provider (SQLOLEDB).

Using C#:

using System.Data.SqlClient;

SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString = “Data Source=(local); Initial Catalog=myDatabaseName; Integrated Security=SSPI”;
//Or
// “Server=(local); Database=myDatabaseName; Trusted_Connection=Yes”;
oSQLConn.Open();

oSQLConn.Close();

// If you open the connection, then close the connection!
// Otherwise the connection does not go back into the connection pool.
// Note the SqlDataAdapter will open and close the connection for you
// when calling it’s Fill or Update methods. However if the connection
// is already open, the SqlDataAdapter will leave it open.

Using VB.NET:

Imports System.Data.SqlClient

Dim oSQLConn As SqlConnection = New SqlConnection()
oSQLConn.ConnectionString = _
“Data Source=(local); Initial Catalog=myDatabaseName; Integrated Security=SSPI”
oSQLConn.Open()

If connection to a remote server (via IP address):

oSQLConn.ConnectionString = _
“Network Library=DBMSSOCN; Data Source=xxx.xxx.xxx.xxx,1433; Initial Catalog=myDatabaseName; User ID=myUsername Password=myPassword”
oSQLConn.Open()

Where:

- “Network Library=DBMSSOCN” tells SqlClient to use TCP/IP
Q238949

- xxx.xxx.xxx.xxx is an IP address of the remote SQL Server.

- 1433 is the port number for the remote SQL Server.
Q269882 and
Q287932

- You can also add “Encrypt=yes” for
encryption

For more information, see:
SqlConnection Class,
Q308656, and
.NET Data Providers

To view Microsoft KB articles related to SQLClient,
click here

Note: Microsoft
SQLXML Managed Classes exposes the functionality of SQLXML inside the Microsoft
.NET Framework.

MySQLDirect .NET Data Provider – From CoreLab (CoreLab.MySql)

MySQLDirect .NET is data provider to direct access to MySQL database server for
the Microsoft .NET Framework and .NET Compact Framework. It is completely based
on ActiveX Data Objects for the .NET Framework (ADO.NET) technology. ADO.NET provides
a rich set of components for creating distributed, data-sharing applications. It
is an integral part of the .NET Framework, providing access to relational data,
XML, and application data.

MySQLDirect .NET data provider can be used in the same way as the SQL Server .NET
or the OLE DB .NET Data Provider. Data provider can access MySQL server either using
native MySQL network protocol directly or through MySQL client library. It allows
to create lightweight and fast applications working with MySQL.

Using C#

using CoreLab.MySql;

MySqlConnection oMySqlConn = new MySqlConnection();
oMySqlConn.ConnectionString = “User ID=myUsername;” +
“Password=myPassword; Host=localhost; Port=3306; Database=myDatabaseName; Direct=true; Protocol=TCP; Compress=false; Pooling=true; Min Pool Size=0; Max Pool Size=100; Connection Lifetime=0″;
oMySqlConn.Open();

Using VB.NET

Imports CoreLab.MySql

Dim oMySqlConn As MySqlConnection = New MySqlConnection()
oMySqlConn.ConnectionString = _
“User ID=myUsername; Password=myPassword; Host=localhost; Port=3306; Database=myDatabaseName; Direct=true; Protocol=TCP; Compress=false; Pooling=true; Min Pool Size=0; Max Pool Size=100;Connection Lifetime=0″
oMySqlConn.Open()

For more information, see: CoreLab’s MySqlDirect
.NET Data Provider. Download
here. Support forms
here.

ODBC .NET Data Provider (System.Data.ODBC)

The Open Database Connectivity (ODBC) .NET Data Provider provides access to native
ODBC drivers the same way the OLE DB .NET Data Provider provides access to native
OLE DB providers.

Note: This namespace, class, or member is supported only in version
1.1 of the .NET Framework.

For SQL Server ODBC Driver

‘ VB.NET Imports System.Data.Odbc

Dim oODBCConnection As OdbcConnection
Dim sConnString As String = _
“Driver={SQL Server}; Server=MySQLServerName; Database=MyDatabaseName; Uid=MyUsername; Pwd=MyPassword”
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()

For Oracle ODBC Driver

‘ VB.NET Imports System.Data.Odbc

Dim oODBCConnection As OdbcConnection
Dim sConnString As String = _
“Driver={Microsoft ODBC for Oracle}; Server=OracleServer.world; Uid=myUsername; Pwd=myPassword”
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()

For Access (JET) ODBC Driver

‘ VB.NET Imports System.Data.Odbc

Dim oODBCConnection As OdbcConnection
Dim sConnString As String = _
“Driver={Microsoft Access Driver (*.mdb)}; Dbq=c:\somepath\mydb.mdb;”
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()

For Sybase System 11 ODBC Driver

‘ VB.NET Imports System.Data.Odbc

Dim oODBCConnection As OdbcConnection
Dim sConnString As String = _
“Driver={Sybase System 11}; SRVR=mySybaseServerName; DB=myDatabaseName; UID=myUsername; PWD=myPassword”
oODBCConnection = New OdbcConnection(sConnString)
oODBCConnection.Open()

For all other ODBC Drivers

‘ VB.NET Imports System.Data.Odbc

Dim oODBCConnection As OdbcConnection
Dim sConnString As String = _
“Dsn=myDsn; Uid=myUsername; Pwd=myPassword”
oODBCConnection = New Odbc.OdbcConnection(sConnString)
oODBCConnection.Open()

For more information, see:
OdbcConnection Class and
.NET Data Providers.

To view Microsoft KB articles related to OdbcConnection,
click here.

OLE DB .NET Data Provider (System.Data.OleDb)

The Microsoft .NET Framework Data Provider for OLE DB allow you to use native OLE
DB providers (e.g. Microsoft.JET.OLEDB.4.0) through COM interop to enable data access.

For IBM AS/400 OLE DB Provider

‘ VB.NET Imports System.Data.OleDb

Dim oOleDbConnection As OleDbConnection
Dim sConnString As String = _
“Provider=IBMDA400.DataSource.1; Data source=myAS400DbName; User Id=myUsername; Password=myPassword”
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()

For JET OLE DB Provider

‘ VB.NET Imports System.Data.OleDb

Dim oOleDbConnection As OleDbConnection
Dim sConnString As String = _
“Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\myPath\myJet.mdb; User ID=Admin; Password=”
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()

For Oracle OLE DB Provider

‘ VB.NET Imports System.Data.OleDb

Dim oOleDbConnection As OleDbConnection
Dim sConnString As String = _
“Provider=OraOLEDB.Oracle; Data Source=MyOracleDB; User ID=myUsername; Password=myPassword”
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()

For SQL Server OLE DB Provider

‘ VB.NET Imports System.Data.OleDb

Dim oOleDbConnection As OleDbConnection
Dim sConnString As String = _
“Provider=sqloledb; Data Source=myServerName; Initial Catalog=myDatabaseName; User Id=myUsername; Password=myPassword”
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()

For Sybase ASE OLE DB Provider

‘ VB.NET Imports System.Data.OleDb

Dim oOleDbConnection As OleDbConnection
Dim sConnString As String = _
“Provider=Sybase ASE OLE DB Provider; Data Source=MyDataSourceName; Server Name=MyServerName; Database=MyDatabaseName; User ID=myUsername; Password=myPassword”
oOleDbConnection = New OleDb.OleDbConnection(sConnString)
oOleDbConnection.Open()

For more information, see:
OleDbConnection Class and
.NET Data Providers.

To view Microsoft KB articles related to OleDbConnection,
click here.

Oracle .NET Data Provider – From Microsoft (System.Data.OracleClient)

The Microsoft .NET Framework Data Provider for Oracle is an add-on component to
the .NET Framework 1.0 that provides access to an Oracle database using the Oracle
Call Interface (OCI) as provided by Oracle Client software. Oracle 8i Release 3
(8.1.7) Client or later must be installed for this provider to function correctly.

Note: This namespace, class, or member is supported only in version
1.1 of the .NET Framework.

Using C#:

using System.Data.OracleClient;

OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = “Data Source=Oracle8i; Integrated Security=SSPI”;
oOracleConn.Open();

Using VB.NET:

Imports System.Data.OracleClient

Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = “Data Source=Oracle8i; Integrated Security=SSPI”;
oOracleConn.Open()

For more information, see:
OracleConnection Class and
.NET Data Providers.

To view Microsoft KB articles related to OracleConnection,
click here.

Oracle .NET Data Provider – From Oracle (Oracle.DataAccess.Client)

The Oracle Data Provider for .NET (ODP.NET) features optimized data access to the
Oracle database from a .NET environment. ODP.NET allows developers to take advantage
of advanced Oracle database functionality, including Real Application Clusters,
XML DB, and advanced security. The data provider can be used from any .NET language,
including C# and Visual Basic .NET.

ODP.NET makes using Oracle from .NET more flexible, faster, and more stable. ODP.NET
includes many features not available from other .NET drivers, including Multiple
Active Result Sets (MARS), a native XML data type, the ability to bind array parameters,
and flexible LOB tuning. ODP.NET is designed for scalable enterprise Windows solutions
by providing full support for Unicode and local and distributed transactions. Distributed
transactions are supported using the Oracle Services for MTS.

Using C#

using Oracle.DataAccess.Client;

OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = “Data Source=MyOracleServerName; Integrated Security=SSPI”;
oOracleConn.Open();

Using VB.NET

Imports Oracle.DataAccess.Client

Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = _
“Data Source=MyOracleServerName; Integrated Security=SSPI”;
oOracleConn.Open();

For more information, see:
Oracle Data Provider for .NET.

OraDirect .NET Data Provider – From CoreLab (CoreLab.Oracle)

OraDirect .NET is a data provider to direct access to Oracle database server for
the Microsoft .NET Framework and .NET Compact Framework. It is completely based
on ActiveX Data Objects for the .NET Framework (ADO.NET) technology. ADO.NET provides
a rich set of components for creating distributed, data-sharing applications. It
is an integral part of the .NET Framework, providing access to relational data,
XML, and application data.

OraDirect .NET data provider can be used in the same way as the SQL Server .NET
or the OLE DB .NET Data Provider. OraDirect .NET can access Oracle server using
Oracle Call Interface (OCI) or through TCP/IP directly.

Using C#

using CoreLab.Oracle;

OracleConnection oOracleConn = new OracleConnection();
oOracleConn.ConnectionString = “User ID=myUsername;” +
“Password=myPassword; Host=(local); Pooling=true; Min Pool Size=0; Max Pool Size=100; Connection Lifetime=0″;
oOracleConn.Open();

Using VB.NET

Imports CoreLab.Oracle

Dim oOracleConn As OracleConnection = New OracleConnection()
oOracleConn.ConnectionString = “User ID=myUsername; Password=myPassword; Host=(local); Pooling=true Min Pool Size=0; Max Pool Size=100; Connection Lifetime=0″
oOracleConn.Open()

For more information, see: OraDirect .NET Data Provider.
Download here. id=”dnn_ctr413_HtmlModule_HtmlHolder0″> Support forms
here.

PostgreSQLDirect .NET Data Provider – From CoreLab (CoreLab.PostgreSql)

PostgreSQLDirect .NET is data provider to direct access to PostgreSQL database for
the Microsoft .NET Framework and .NET Compact Framework. It completely based on
ActiveX Data Objects for the .NET Framework (ADO.NET) technology. ADO.NET provides
a rich set of components for creating distributed, data-sharing applications. It
is an integral part of the .NET Framework, providing access to relational data,
XML, and application data.

PostgreSQLDirect .NET data provider can be used in the same way as the SQL Server
.NET or the OLE DB .NET Data Provider.

Using C#

using CoreLab.PostgreSql;

PgSqlConnection oPgSqlConn = new PgSqlConnection();
oPgSqlConn.ConnectionString = “User ID=myUsername;” +
“Password=myPassword;” +
“Host=localhost;” +
“Port=5432;” +
“Database=myDatabaseName;” +
“Pooling=true;” +
“Min Pool Size=0;” +
“Max Pool Size=100;” +
“Connection Lifetime=0″;
oPgSqlConn.Open();

Using VB.NET

Imports CoreLab.PostgreSql

Dim oPgSqlConn As PgSqlConnection = New PgSqlConnection()
oPgSqlConn.ConnectionString = “User ID=myUsername; Password=myPassword; Host=localhost; Port=5432; Database=myDatabaseName; Pooling=true; Min Pool Size=0; Max Pool Size=100; Connection Lifetime=0″
oPgSqlConn.Open()

For more information, see: PostgreSQLDirect
.NET Data Provider. Download
here. Support forms
here.

Sybase Adaptive Server (ASE) Enterprise .NET Data Provider ( name=”AseClientManagedProvider”>Sybase.Data.AseClient)

The ASE Enterprise .NET Data Provider is an
add-on component to the .NET Framework that allows you to access a Sybase
Adaptive Server Enterprise (ASE) database.

Using C#

using Sybase.Data.AseClient;

AseConnection oAseConn = new AseConnection();
oAseConn.ConnectionString = “Data Source=(local); Initial Catalog=myDatabaseName; User ID=myUsername; Password=myPassword”
oAseConn.Open();

Using VB.NET

Imports System.Data.AseClient

Dim oAseConn As AseConnection = New AseConnection()
oAseConn.ConnectionString = “Data Source=(local); Initial Catalog=myDatabaseName; User ID=myUsername; Password=myPassword”
oAseConn.Open()

For more information, see:
ASE User’s Guide.

VistaDB (VistaDB.Provider)

The VistaDB
Provider allows you to access a VistaDB
database.

Using C#

using VistaDB.Provider;

string connectionString = @”Data Source = C:\VistaDB.vdb3;
Open Mode = ExclusiveReadWrite”;
VistaDBConnection connection = new VistaDBConnection(connectionString);
connection.Open();

Using VB.NET

Imports VistaDB.Provider

Dim vistaDBConnection As VistaDBConnection = New VistaDBConnection()
vistaDBConnection.ConnectionString = @”Data Source = C:\VistaDB.vdb3;
Open Mode = ExclusiveReadWrite”;
vistaDBConnection.Open()

No Comments


Error: The installer was interrupted [AppName] could not be installed


Installing a .net application on different platforms would be a headache if you are not familiar with every details on how it work.

One of the error more often happened is the “The Installer was interrupted [AppName] could be installed. You need to restart the installer to try again.” as depicted below

To resolve this issue, there’s a service that need to be enabled IIS Metabase and IIS 6 configuration compatibility”

Under windows 7:

  1. Go to Control Panel
  2. Programs
  3. Turns windows features on or off.
Under Windows 2008:
  1. Launch the Server Manager
  2. Roles
  3. enable the IIS Metabase and IIS 6 configuration compatibility

No Comments


Searching Xml Element in any namespace using vb.net


If you know the namespaces that is in the xml document you can use XmlNamespaceManager;

  1. Dim xmlDoc As New XmlDocument()
  2. xmlDoc.Load(Path.Combine(mDirectory, name + "\" + name + ".vbproj"))          '"
  3.  
  4. Dim nsmgr As New XmlNamespaceManager(xmlDoc.NameTable)
  5. nsmgr.AddNamespace("msb", "http://schemas.microsoft.com/developer/msbuild/2003")
  6.  
  7. Dim xpath As String = "/msb:Project/msb:PropertyGroup/msb:ProjectGuid"
  8. Dim value As Object = xmlDoc.SelectNodes(xpath, nsmgr)

else you can use the general XPath syntax

//*[local-name() = 'ProjectGuid']

Source

No Comments



SetPageWidth