Click here to Skip to main content
15,919,132 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
hello

I have make one small desktop application in visual studio 2010 . In this i used one crystal report.
It is working properly in development side. But when i make its setup & install in client machine, it will close whole application.It means it stops whole process.

What can I do in this situation ?

I have seen the problem in Dataset when execution control comes on dataset it will close whole application.


What I have tried:

I am using visual studio 2010 & crystal report for vs2010 .
Posted
Updated 11-Sep-16 22:19pm
Comments
Patrice T 12-Sep-16 3:18am    
Mehdi Gholam 12-Sep-16 3:35am    
My 5! :)
Patrice T 12-Sep-16 4:04am    
Too bad I didn't used a solution :)
Maciej Los 12-Sep-16 4:07am    
So, use it! I'll upvote it!
khushbujasmine 12-Sep-16 5:32am    
Actually my English is little bit slow. So my question is like this.

Quote:
I have seen the problem in Dataset when execution control comes on dataset it will close whole application.

Then the most likely reason is that you don't use any try-catch blocks to try to locate and handle errors properly, and your connection string is probably wrong. Development and production do not normally use the same connection string - or even the same database - so unless your code is set up to use a configuration system to store the connection string, it's probably still trying to reference your development SQL Server instance. EVen if it is, you need to check what that string is, and that it's correct for the actual instance of SQL that it references. And that the instance has a copy of the database. And ... you get the idea.
We can't do any of that for you: so check it all very carefully, and add try - catch blocks to report problems (including any inner exception) so that you get told what the error actual is rather than "it crashed".
 
Share this answer
 
Comments
khushbujasmine 12-Sep-16 5:22am    
Hello
I used try & catch block.

conn = GetConnection();

if (fieldname == "All")
{
cmd = new SqlCommand("select * from tbl_Expense order by nTitle", conn);
}

else if (equality == "equal")
{
cmd = new SqlCommand("select * from tbl_Expense where " + fieldname + "='" + values + "' order by nTitle asc", conn);
}
else if (equality == "Like")
{
cmd = new SqlCommand("select * from tbl_Expense where " + fieldname + " like '%" + values + "%' order by nTitle asc", conn);
}
else if (equality == "Less")
{
cmd = new SqlCommand("select * from tbl_Expense where " + fieldname + " < " + float.Parse(values) + " order by nTitle asc", conn);
}

cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);

DataSet dsreport = new DataSet();
dsreport.Clear();

try
{

da.Fill(dsreport, "tbl_Expense");

}
catch (SqlException)
{

}
return dsreport;

All database queries are correct & database connectivity is also correct.
OriginalGriff 12-Sep-16 5:28am    
And you swallowed any exceptions, so you have no idea what went wrong, if anything...
khushbujasmine 12-Sep-16 5:33am    
When i run this program in visual studio ,i traced line by line, not any exception given.
it is working properly.
OriginalGriff 12-Sep-16 5:39am    
Yes.
But you don't run it under VS in production, do you?
And that's where it's failing...so that's where you need to gather information instead of throwing it away.
khushbujasmine 12-Sep-16 5:51am    
I cant understand your question, "But you don't run it under VS in production, do you?" What it means ?
Well, you didn't provide much information but...

MS wrote:
To provide Crystal Reports runtime files, your setup projects must include the Crystal Reports for .NET Framework 2.0 Redistribution Package or Crystal Reports merge modules. Crystal Reports merge modules are available for 32 and 64-bit machines.

source: Crystal Reports Deployment Overview[^]

This mean, you need to install Crystal Reports runtime files on client machine to be able to use it.
 
Share this answer
 
Comments
khushbujasmine 12-Sep-16 5:29am    
I had installed dotNetFx40_Client_x86_x64 , crystal report (CRforVS_redist_install_32bit_13_0),
sql server 2008.
Maciej Los 12-Sep-16 5:48am    
And...
khushbujasmine 12-Sep-16 5:56am    
and my application not any else.

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