Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
3.80/5 (3 votes)
See more:
How to make Crystal Report for this ....

try
{


if (conn.State == ConnectionState.Open)
{
conn.Close();
}
conn.Open();
SqlCommand cmd = new SqlCommand("insetclientinfo", conn);
cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@clientId", txtid.Text);
cmd.Parameters.AddWithValue("@name", txtname.Text);
cmd.Parameters.AddWithValue("@mobile", txtmobile.Text);
cmd.Parameters.AddWithValue("@address", txtaddress.Text);
cmd.Parameters.AddWithValue("@cnic", txtcnic.Text);
cmd.Parameters.AddWithValue("@city", txtcity.Text);

SqlDataAdapter adapter = new SqlDataAdapter();
adapter.InsertCommand = cmd;
adapter.InsertCommand.ExecuteNonQuery();
cmd.Connection.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);

}
finally
{
this.conn.Close();

}
Posted
Updated 3-Feb-14 2:24am
v3

1 solution

You have to use parameter field[^](for client id) to generate report for that Client ID

Check this tutorials
C# Crystal Reports Tutorial[^]
 
Share this answer
 
Comments
abdul manan 7 3-Feb-14 9:20am    
Thanks

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