|
You should explain your problem with SQL Query and what is the error message is show.
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
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
|
|
|
|
|
I am developing this tool specifically for our product. The product is called Process Expert. There are different blocks in which industrial process values are stored which in turn stores in mdb. A set of blocks is called a worksheet. In some blocks VB code is written to stablize the industrial process. I need to compare two different worksheets. I am able compare all the values, but I need to compare the VB code. If any body can help how to go about it, it will be helpful for me.
Regards
Surya
|
|
|
|
|
So... you are doing SCADA by embedding VBA into Access databases? I'm concerned.
|
|
|
|
|
Mark Churchill wrote: I'm concerned
Other than the choice of the toolset - why?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It seems like part of the supervisory routines are going to be somehow embedded in the database. I had the horrible thought of live process data being pumped thru embedded VB which affects more than just setpoints. Usually I find these kind of decisions embedded in a supervisory PLC. Or maybe I'm just paranoid...
|
|
|
|
|
This is a tool for the commisioners to check if the installed software is different from the standard. I don't understand "I'm concerned" ????.
|
|
|
|
|
A simple string comparison would be easy but I assume you want to compare the logic/tokens in the code, in which case you will need to build and interpreter of some sort.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how i create no. of pictures boxes during runtime. The no. of picture boxes is equal to the no. of images in a folder.
Thanks
|
|
|
|
|
use IO namespace to get the folder and file info
loop through the files in the folder counting/creating a picturebox for each one
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
do following steps :
1. list files in your selected directory using System.IO.Directory.GetFiles(PathToYourImageDirectory);
2. iterate along list of files in step no 1
3. Create a PictureBox ie : PictureBox pb = new PictureBox();
4. Set your picture box property in step no 3, like Top, Left, Widht and Height.
5. Add your picture box to your form or other container control you use, with yourParentControl.Controls.Add(pb)
6. Load your image to picture box using pb.Image = Image.FromFile(TheFileFromList)
7. Repeat step no 3 until all files processed.
hope this helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Thanx A lot.......
|
|
|
|
|
i have had problems refreshing the datagrid when deleting an item or when adding data; when i run my program. However when i step into the code line by line the datagrid works as expected by clearing or adding the data and updating the result on the datagride, why is that?
D.Arnold
dave1816
|
|
|
|
|
How about showing some code? Nobody can divine the solution from your question.
|
|
|
|
|
a
dave1816
modified on Wednesday, April 15, 2009 8:16 AM
|
|
|
|
|
Hi,
i getting started with ado and how been sucessful so far, however im now trying to update the data when editing a record, however i can only find how to do this with one set of data involving one column not mulitple.
e.g.
update Patient set Lastname = '" + textBox2.Text + "' where patientunitno = '" + textBox1.Text + "'";
my question is probley rather simple to solve but i cant find anything on google. I must be trying the wrong type of key words in.
I did find however one article linked below
http://www.xtremedotnettalk.com/showthread.php?t=95074[^]
however im not sure if this is the most practical way? any help to point me in the right direction would be great
Many Thanxs
D.Arnold
dave1816
|
|
|
|
|
Just write your sql command text like this:
"update patient set lastname = '" + textbox2.Text + "', firstname = '" + textbox3.Text + "' where patientunitno = '" + textBox1.Text + "'";
and so on if you want to update more columns.
but this suggestion is not recommended because it vulnerable against sql injections, use parameters instead.
Hope it helps
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
Clearly, I type too slowly
|
|
|
|
|
1. You should have probably gone for the database forum; this is more of an SQL question.
2. You should certainly be able to update multiple columns in one query. I just tried this in SQL Server and it worked:
update tablename set column1 = 'value1', column2 = 'value2' where column3 = 'condition'
3. You should never construct SQL like this. Google for "SQL injection".
|
|
|
|
|
Hi,
is there a possibility to clone a DataGridView?
I have a little formated Grid in a form and want to "copy" it to show and edit it in another form.
Cell- und backgroundcolors have to be retained unchanged. Thats why a DatagridView.DataSource solution is not so good.
Form1.CloneMemberWise() did't work. The source grid disapeared;
Thanx for your help.
Christian
from Germany
www.mindronics.de
|
|
|
|
|
Hi,
I am studying for MCTS and there i have a question fro practise purposes. The question is "Create a custom class that can be converted to common value types"?
I have been trying to solve this since 1 week but can not get the soluution of it.
Can any one help me with this answer...
Thanks in advance
Thanks
|
|
|
|
|
Faisal Khatri wrote: The question is "Create a custom class that can be converted to common value types"?
It sounds like the question is talking about Serialisation.
All types, eventually, boil down to some basic types such as int, string, double, bool etc.
For example, a Customer type may consist of an account number, a surname, forename, address (another custom type), etc. Account number could just be an int, while surname and forename are strings.
Serialisation (and its counterpart deserialisation) is the process of taking complex types and representing them in a common way so that they can be transferred to other systems or persisted to a storage medium.
Probably one of the most common ways to serialise stuff is to use XML, which is at its most basic just a big string.
Of course you can come up with your own scheme for serialising a type.
Now, whether this is what your tutor wants, I don't know. If they are careless with their vocabulary then it probably is. If they are very careful with their word usage then no. In .NET a "value type" has a very specific meaning, and a string (although immutable and therefore often confused with a value type) isn't a value type.
Does this help at all? Or does it just raise more questions?
|
|
|
|
|
Hi Guys,
I'm stumped about this.. I have a custom form that creates an instance of another customer form and displays it modally. There are a couple of buttons and events on the modal dialog window. It basically sets properties of the parent form based on user selections.
While I've got everything working just fine. The complaint I have is that the parent window isn't painted quickly enough. In other words, remnants of the modal window remain for a couple of seconds before it goes away entirely. How do I solve such a problem?
Here is a simple version of what I'm doing. Again, the problem I have is the ModalForm instance isn't "closing" fast enough- ie that it kind of fades then blends into the parent form instance.
public partial class ModalForm : Form
{
Button theButton; ...etc.
public ModalForm
{
theButton.Click+= new EventHandler(ClickHandler)
}
public void ClickHandler(object sender, Eventargs e)
{
objParenForm.myProperty = 1;
Dispose();
}
}
public partial class ParentForm : Form
{
ModalForm mForm
public int myProperty;
public void ParentForm_Load(object sender, Eventargs e)
{
mForm = new ModalForm();
mForm.Show(this);
}
}
|
|
|
|
|
Should you not be using ShowDialog for the modal form? Are you using any animations, I have not seen this problem and I use showdialog ALL the time. I suspect there is a setting somewhere that is controlling your form close style or something.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I'm sorry. Posted that code rather quickly.. you're right, I did use ShowDialog to show the form. No animations, just standard controls.. buttons, listbox.
Any hints as to where I could look to confirm your suspicion?
|
|
|
|
|