Click here to Skip to main content
15,890,845 members
Home / Discussions / C#
   

C#

 
QuestionConverting pcl format to pdf format Pin
MarcoDF8913-Apr-09 19:02
MarcoDF8913-Apr-09 19:02 
QuestionHow i check the Ans of objective question using Radio Button Pin
Ravindra Bisen13-Apr-09 19:00
Ravindra Bisen13-Apr-09 19:00 
AnswerRe: How i check the Ans of objective question using Radio Button Pin
Mycroft Holmes13-Apr-09 19:20
professionalMycroft Holmes13-Apr-09 19:20 
AnswerRe: How i check the Ans of objective question using Radio Button Pin
Pedram Behroozi13-Apr-09 20:06
Pedram Behroozi13-Apr-09 20:06 
QuestionProblem in executing Stored Procedure through ODBC Pin
Renukapadhamanaban13-Apr-09 18:11
Renukapadhamanaban13-Apr-09 18:11 
AnswerRe: Problem in executing Stored Procedure through ODBC Pin
Vikram A Punathambekar13-Apr-09 18:16
Vikram A Punathambekar13-Apr-09 18:16 
AnswerRe: Problem in executing Stored Procedure through ODBC Pin
Anubhava Dimri13-Apr-09 18:33
Anubhava Dimri13-Apr-09 18:33 
GeneralRe: Problem in executing Stored Procedure through ODBC Pin
Renukapadhamanaban13-Apr-09 19:34
Renukapadhamanaban13-Apr-09 19:34 
Hi Vikram and Anubhav,

Thanks a lot for the quick reply. Sorry for not explaining the problem clearly. here it is..

I have the Stored procedure written in sybase called PatientDetails

CREATE PROCEDURE PatientDetails2
(
@local_id VARCHAR (8)
, @facility VARCHAR (5) = 'RMH'
)
AS

SELECT lname = per.last_name, fname = per.first_name, mname = per.middle_name, per.title, dob = CONVERT(VARCHAR(10),per.dob,103)
, per.sex, per.mstatus, per.ssn, per.race, per.ethnic, per.religion, per.language, per.pob_country
, loc.facility, UR = loc.local_id
, pv1.visit_no, pv1.alternate_visit_id, pv1.admission_type, unit = pv1.hospital_service, ward = pv1.nurse_unit, pv1.room, pv1.bed
, admitted = pv1.admit_date_time, discharged = pv1.discharge_date_time, fin_class = pv1.financial_class
, admitting_dr = pv1.admitting_doctor, attending_dr = pv1.attending_doctor, consulting_dr = pv1.consulting_doctor, referring_dr = pv1.referring_doctor
, raddress1 = radr.address1, raddress2 = radr.address2, rcity = radr.city, rpostcode = radr.postal_code --residential
, maddress1 = madr.address1, maddress2 = madr.address2, mcity = madr.city, mpostcode = madr.postal_code --mailing
, hphone = hpho.phone --home
, bphone = bpho.phone --business

INTO #patients FROM ui_person per JOIN (ui_local_id loc
LEFT JOIN ui_pv1_segment pv1 ON (loc.local_id = pv1.local_id)
AND (loc.facility = pv1.facility))ON (per.u_id = loc.u_id)
LEFT JOIN ui_address radr ON per.u_id = radr.u_id
AND (radr.address_type = 'R')LEFT JOIN ui_address madr ON (per.u_id = madr.u_id AND madr.address_type = 'M')LEFT JOIN ui_phone hpho ON (per.u_id = hpho.u_id AND hpho.phone_type = '1') LEFT JOIN ui_phone bpho ON (per.u_id = bpho.u_id AND bpho.phone_type = '2')

WHERE loc.local_id = @local_id
AND loc.facility = @facility

RETURN

This works very fine for all the combination of the parameter values. I tested this in the AQL Advantage window.

Inside .NEt application i have written code to call this SP like this:

private DataTable PatientInformationRow(string ur, string facility, string procString) //procString=PatientDeatails2
{
OdbcConnection conn = new OdbcConnection(m_connString);
conn.Open();
OdbcCommand commDemo = new OdbcCommand();
commDemo.Connection=conn;
commDemo.CommandText="{call " + procString + "(?,?)}";

OdbcParameter urParam =commDemo.Parameters.Add("@local_id", OdbcType.VarChar);
urParam.Value= ur;
OdbcParameter facParam = commDemo.Parameters.Add("@facility", OdbcType.VarChar);
facParam.Value= facility;

OdbcDataAdapter daDemo = new OdbcDataAdapter(commDemo);

DataTable dtDemo = new DataTable();
try
{
daDemo.Fill(dtDemo);
}
catch(Exception e)
{
throw new Exception(e.Message);
}
conn.Close();
return dtDemo;
}

For example, If I pass the @local_id parameter value '123456', the SP works fine and returns the right patient record if I execute in the SQL advantage window and as well as through the .NET code. IF i pass '131534' it brings the right patient record if I execute in the sql advantage window but bringing no records through the .NET code. (this is what i specified as not working for fewer parameter values..) it is very weird..

I think i explained well... hoping for some help.

THanks in advance.

Renu
QuestionComponent for comparing VB codes in c# program Pin
Surya Ayyagari13-Apr-09 17:39
Surya Ayyagari13-Apr-09 17:39 
AnswerRe: Component for comparing VB codes in c# program Pin
Mark Churchill13-Apr-09 18:04
Mark Churchill13-Apr-09 18:04 
GeneralRe: Component for comparing VB codes in c# program Pin
Mycroft Holmes13-Apr-09 18:06
professionalMycroft Holmes13-Apr-09 18:06 
GeneralRe: Component for comparing VB codes in c# program Pin
Mark Churchill13-Apr-09 18:22
Mark Churchill13-Apr-09 18:22 
GeneralRe: Component for comparing VB codes in c# program Pin
Surya Ayyagari13-Apr-09 18:13
Surya Ayyagari13-Apr-09 18:13 
AnswerRe: Component for comparing VB codes in c# program Pin
Mycroft Holmes13-Apr-09 18:09
professionalMycroft Holmes13-Apr-09 18:09 
QuestionHow create picture boxes runtime according to no. of pictures in a folder? Pin
abhishek2913-Apr-09 16:58
abhishek2913-Apr-09 16:58 
AnswerRe: How create picture boxes runtime according to no. of pictures in a folder? Pin
Mycroft Holmes13-Apr-09 18:10
professionalMycroft Holmes13-Apr-09 18:10 
AnswerRe: How create picture boxes runtime according to no. of pictures in a folder? Pin
Mbah Dhaim13-Apr-09 18:26
Mbah Dhaim13-Apr-09 18:26 
GeneralRe: How create picture boxes runtime according to no. of pictures in a folder? Pin
abhishek2913-Apr-09 20:01
abhishek2913-Apr-09 20:01 
QuestionData gride update/refresh - works when stepping through code but not when running the program Pin
dave181613-Apr-09 15:40
dave181613-Apr-09 15:40 
AnswerRe: Data gride update/refresh - works when stepping through code but not when running the program Pin
Vikram A Punathambekar13-Apr-09 17:40
Vikram A Punathambekar13-Apr-09 17:40 
AnswerRe: Data gride update/refresh - works when stepping through code but not when running the program [modified] Pin
dave181614-Apr-09 12:33
dave181614-Apr-09 12:33 
Questionhow to update mutliple columns with ado to a database? Pin
dave181613-Apr-09 15:01
dave181613-Apr-09 15:01 
AnswerRe: how to update mutliple columns with ado to a database? Pin
Mbah Dhaim13-Apr-09 17:42
Mbah Dhaim13-Apr-09 17:42 
GeneralRe: how to update mutliple columns with ado to a database? Pin
Vikram A Punathambekar13-Apr-09 17:50
Vikram A Punathambekar13-Apr-09 17:50 
AnswerRe: how to update mutliple columns with ado to a database? Pin
Vikram A Punathambekar13-Apr-09 17:48
Vikram A Punathambekar13-Apr-09 17:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.