ASP.NET
--
Questions
--
Followers
Top Experts
Cannot Implicitly Convert type 'int' to 'string' c# , sql server
trying to insert sql statement by passing in parameters,
but one of the parameters datatype does not fit,
have checked that the datatype field in sql server are matched with the parameters datatype,
but one of the parameters datatype does not fit,
have checked that the datatype field in sql server are matched with the parameters datatype,
string strInsertStatus = InsertStudentAttendanceNTraineeModule(Convert.ToDateTime(dtSAC.Rows[0]["arrivedtime"]), Convert.ToDateTime(dtSAC.Rows[0]["actualtime"]),
Convert.ToDateTime(dtSAC.Rows[0]["leavetime"]), Convert.ToDateTime(dtSAC.Rows[0]["actualleavetime"]), dtSAC.Rows[0]["attendancestatus"].ToString(),
dtSAC.Rows[0]["lateduration"].ToString(), dtSAC.Rows[0]["earlierduration"].ToString(), dtSAC.Rows[0]["leavestatus"].ToString(), dtSAC.Rows[0]["absensereason"].ToString(),
Convert.ToInt64(dtTMC.Rows[0]["pid"]), Convert.ToInt64(dtTMC.Rows[0]["ctid"]), Convert.ToInt64(dtTMC.Rows[0]["mid"]), Convert.ToInt64(dtTMC.Rows[0]["lid"]),
Convert.ToInt64(dtTMC.Rows[0]["tid"]), Convert.ToInt64(dtTMC.Rows[0]["trid"]), Convert.ToInt64(dtTMC.Rows[0]["sid"]), Convert.ToInt64(dtTMC.Rows[0]["pid"]));
source from
-----------
select sa1.id as said, sa1.arrivedtime as arrivedtime, sa1.leavetime as leavetime, sa1.actualtime as actualtime, " +
"sa1.attendancestatus as attendancestatus, sa1.lateduration as lateduration, sa1.leavetime as leavetime, sa1.actualleavetime as actualleavetime, " +
"sa1.leavestatus as leavestatus, sa1.earlierduration as earlierduration, sa1.absensereason as absensereason, sa1.leaveearlierby as leaveearlierby from traineemodule tm " +
" JOIN StudentAttendanceC sa1 ON sa1.id = tm.said " +
" WHERE dateadd(month,(((Year(arrivedtime))-1900)*12)+Month(arrivedtime)-1,Day(arrivedtime)-1) = '" + strArrivedTime + "'";

Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
ASKER CERTIFIED SOLUTION
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
gosh,






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
ASP.NET
--
Questions
--
Followers
Top Experts
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications