after i completed all the steps that is given in this tutorial
Walkthrough: Using a Custom Action to Create a Database at Installation[
^]
i got the following error in the middle of the installation process :
Error 1001.Object reference not set to an instance of an object
please help me with this...
provide me with your email address and i will send the solution i made with that tutorial...please help me to find out the error in it...
regards
Arpan
[edit]Code block removed, link converted to link - OriginalGriff[/edit]
[edit]Added OP's reply to the original post - Naerling[/edit]
the code didn't showed any problem in it..i rechecked my steps with the given steps in the tutorial but i did exactly what stated in the tutorial....
though i use c# but the code was given in vb so i used converter to change the vb code to c#
this is the website i used for the conversion
http://www.developerfusion.com/tools/convert/vb-to-csharp/
In the code,
private void ExecuteSql(string DatabaseName, string Sql)
{
System.Data.SqlClient.SqlCommand Command = new System.Data.SqlClient.SqlCommand(Sql, masterConnection);
masterConnection.ConnectionString = My.Settings.masterConnectionString;
Command.Connection.Open();
Command.Connection.ChangeDatabase(DatabaseName);
try {
Command.ExecuteNonQuery();
} finally {
Command.Connection.Close();
}
}
but this line didn't worked i think due to the framework version compatible issues...
masterConnection.ConnectionString = My.Settings.masterConnectionString;
....
it specified the error as "the name 'My' is not in the context"
so i changed the code with
masterConnection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["dbCustomAction.Properties.Settings.masterConnectionString"].ToString();
adding a refrence of system.Configuration
so this code didn't showed any problem...
now i don't know where specifically my problem resides...
can you now help me with this??