Click here to Skip to main content
15,995,012 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All!!
I am using VS.net 2008 and sqlserver 2005
My requirement is:
"I am trying to add a textbox during SETUP and DEPLOYMENT process,where the data(security Key) entered need to b validated with database(sqlserver 2005)"
I tried it adding textbox from customDialog box but i couldn't achieve it!!!!
Is it Possible to do so,Pls Help me out!
Any answers will be highly appreciated!!!
Thanx in aAdvance!!!!!!
Posted
Updated 15-Jun-11 19:48pm
v2
Comments
Member 4152184 3-Aug-11 6:53am    
Hi All!!!
I have done with the code but problem is when the data entered in Customaction Textbox doesnot match with Database Key then it must rollback/stop installation but i couldn't find any solution for it!!!
Is it possible!!
***Pls Help me out****
Thanx in Advance
Member 4152184 3-Aug-11 6:55am    
Here is my code
pls check it!!!!!!

public static string Getid(string id)
{
SqlCommand cmd = new SqlCommand("select Id from cities where Id='" + id+"'", con);
SqlDataReader Dr;
con.Open();
Dr = cmd.ExecuteReader();
if (Dr.Read())
{
con.Close();
return "true";
}
else
{
con.Close();
return "false";
}
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Rollback(IDictionary savedState)
{
base.Rollback(savedState);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
if(Context.Parameters["userpass"].Length>0 )
{
string data=Context.Parameters["userpass"];
string val= Getid(data);
if (val == "false")
{
stateSaver.Add("userpass", data);
base.Uninstall(stateSaver);
}

}
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
}
[System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand)]
public override void Uninstall(IDictionary savedState)
{
base.Uninstall(savedState);
}

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900