Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > Error while developing.

Reply
Thread Tools

Error while developing.

 
 
RTRKarty RTRKarty is offline
Junior Member
Join Date: Dec 2011
Posts: 1
 
      12-23-2011
Hi there,
I have a doubt that, while i am creating crystal reports using c#.net. I have got the error as "Specified cast is not valid".The code is as follows.

str1 = "SELECT sum(dbo.VisitDetails.RegistrationFee) FROM dbo.VisitDetails INNER JOIN dbo.EmployeeMaster ON dbo.VisitDetails.Emp_Id = dbo.EmployeeMaster.Emp_Id where visitid = 1 and EmployeeMaster.Emp_Id = '" + Emp_Id + "' and CAST( CONVERT( varchar(,Visitdate, 112) AS DATETIME) between isnull ('" + dtpOne.Value.ToString("MM/dd/yyyy") + "',VisitDate) and isnull ('" + dtpTwo.Value.ToString("MM/dd/yyyy") + "',VisitDate)and dbo.VisitDetails.RegistrationFee is not null";
cmd =
newSqlCommand(str1, con);
con.Open();
if (!Convert.IsDBNull(Convert.ToDecimal(cmd.ExecuteScalar())))
{
total_NewPatientAmount =
Convert.ToDecimal(cmd.ExecuteScalar());
}

so, please help if you know.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
While deploying application on AIX I got this error. while it's working fine on windows Sam Java 0 06-21-2006 06:26 AM
while loop in a while loop Steven Java 5 03-30-2005 09:19 PM
while 1 vs while True Timothy Fitz Python 16 12-15-2004 09:27 PM
Help while error "Error while trying to run project:" David ASP .Net 1 07-19-2004 08:41 PM
Got error msg while Debugging : Error while trying to run project: ... ^CrazyCoder^ ASP .Net 3 09-15-2003 09:40 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57