TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rachayita jaiswal
NA
217
106.4k
MySql with VB.Net
Jul 16 2013 2:08 AM
Hi,
I created stored procedure like -
-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_Analysis_rpt`( _action varchar(20),
_unitid varchar(10),
_da1 varchar(20),
_da2 varchar(20),
_Driver_query varchar(100),
_MinDisSpeed varchar(50),
_MinAvgSpeed varchar(50),
_AvgSpeed varchar(50))
BEGIN
if _action = 'SelectAnaHalt' then
select * from gprsrecordsview
where TimeStamp between _da1 and _da2
and TrackerId =_UnitId and _Driver_query
And recpos in ('Start','Stop')
order by TimeStamp asc;
end if;
if _action = 'SelectAnaIdle' then
select * from gprsrecordsview
where TimeStamp between _da1 and _da2
and TrackerId =_UnitId and _Driver_query
And ignition_status='ON' and Speed=0 And recpos in ('Start','Stop')
order by TimeStamp asc;
end if;
END
and in my code behind file i have called this stored procedure like this -
AnalysisCmd.CommandText = "call SP_Analysis_rpt(?,?,?,?,?,?,?,?)"
AnalysisCmd.Parameters.AddWithValue("_action", "SelectAnaHalt")
AnalysisCmd.Parameters.AddWithValue("_da1", da1)
AnalysisCmd.Parameters.AddWithValue("_da2", da2)
AnalysisCmd.Parameters.AddWithValue("_UnitId", UnitId)
AnalysisCmd.Parameters.AddWithValue("_Driver_query", Driver_query)
AnalysisCmd.Parameters.AddWithValue("_MinDisSpeed", Nothing)
AnalysisCmd.Parameters.AddWithValue("_MinAvgSpeed", Nothing)
AnalysisCmd.Parameters.AddWithValue("_AvgSpeed", Nothing)
AnalysisDR = AnalysisCmd.ExecuteReader()
AnalysisCmd.CommandText = "call SP_Analysis_rpt(?,?,?,?,?,?,?,?)"
AnalysisCmd.Parameters.AddWithValue("_action", "SelectAnaIdle")
AnalysisCmd.Parameters.AddWithValue("_da1", da1)
AnalysisCmd.Parameters.AddWithValue("_da2", da2)
AnalysisCmd.Parameters.AddWithValue("_UnitId", UnitId)
AnalysisCmd.Parameters.AddWithValue("_Driver_query", Driver_query)
AnalysisCmd.Parameters.AddWithValue("_MinDisSpeed", Nothing)
AnalysisCmd.Parameters.AddWithValue("_MinAvgSpeed", Nothing)
AnalysisCmd.Parameters.AddWithValue("_AvgSpeed", Nothing)
AnalysisDR = AnalysisCmd.ExecuteReader()
but this is nopt correct as a code optimization point of view So
is there any other way to call stored procedure in code behind file??
Reply
Answers (
0
)
no 'Unit' columns in dtPurchaseProductExp but the error show
What and How to Prepare for MTA 98-364 Exam?