|
I am trying to call a oracle stored procedure and can't get it work. I am not sure how to call this from c#.
C#:
[CODE]
OracleParameter ps1 = new OracleParameter("cryst_rep.ref_cur_type", OracleType.Cursor);
ps1.Direction = ParameterDirection.Output;
OracleParameter[] param = { ps1 };
ahpDataSet = aDataBase.ExecuteDataSet("ReconcileHardm", param);
[/CODE]
Oracle stored proc looks like this:
create or replace PROCEDURE ReconcileHardm(io_cursor IN OUT portfolios.cryst_rep.ref_cur_type) IS
tmpVar NUMBER;
BEGIN
-- Join the two temp tables and do the reconciliation
OPEN io_cursor FOR
SELECT FAS133.DEAL, HEDGES.HEDGE_DEAL, FAS133.MTC_MV, HEDGES.Instrument_MV, FAS133.HEDGE_MV, HEDGES.HEDGE_MV,
FAS133.MTC_CURRENT_PAR,HEDGES.INSTRUMENT_PAR FROM TEMP_FAS133_MAIN_COPY FAS133 INNER JOIN TEMP_HEDGES_MON_f HEDGES
ON FAS133.DEAL = HEDGES.HEDGE_DEAL
WHERE FAS133.HEDGE_MV<>HEDGES.HEDGE_MV OR FAS133.MTC_CURRENT_PAR<>HEDGES.INSTRUMENT_PAR
OR FAS133.MTC_MV <> HEDGES.Instrument_MV ORDER BY DEAL;
--io_cursor := v_cursor;
END ReconcileHardm;
|
|
|
|
|
i want to make remote connection to mySQL Database ??
what the best method to do that ...0...
Palestine
|
|
|
|
|
I've been using generic collection classes in the .net 2 framework for some time, but came across a problem that I thought might be solved by a generic method.
I have a combo box that contains ints representing enums as well as the localized text version of that particular enum.
I use a utility method to load those combos based on the name of the enum list, I just pass a combo and a name for the list and the rest is automatic.
Now I want to do the same in reverse with the selected value, so I thought rather than handling each enum in my form code I'll write a general purpose util method, pass it a combo box and an enum type and it will magically return the selected enum of the correct type for storing in my business object.
Seeing as how this will work normally (where DayOfWeek is an int enum):
DayOfWeek d=(DayOfWeek)nIntValue;
I thought, ok, how about a method that uses generics for all enum based combo box
value retrieval and tried this:
static public T Test<t>(RadComboBox cb, T enumtype)
{
return cb.Value as T;
//Or return (T) cb.Value; //doesn't work either
}
but the compiler choked on it:
The type parameter 'T' cannot be used with the 'as' operator because it does not have a class type constraint nor a 'class' constraint
I'm guessing it's just not possible to cast that cb.Value (which is an int btw) back to the original enum value...or is it?
|
|
|
|
|
This compiles fine so I suspect the "type"of RadComboBox.Value
enum foo { Bar, Other };
private foo testfoo(int n)
{
return (foo)n;
} Oh Generics, sorry, nevermind.
Last modified: 16mins after originally posted -- I'm a moron
led mike
|
|
|
|
|
led mike wrote: Last modified: 16mins after originally posted -- I'm a moron
Yeah, exactly what I want to replicate only using generics. I've pored over every doc I can find on Generics but I guess I'm just trying to do something that isn't allowed.
|
|
|
|
|
Try using Enum.Parse , for example:
public class Class<T>
{
public static T GetValue(ComboBox cbxControl)
{
return (T) Enum.Parse(typeof(T), cbxControl.SelectedText);
}
}
I would suggest though putting some wrappers around this for error checking/catching/etc.
Hope that helps.
|
|
|
|
|
Ahh! I see where I went wrong, if you define the method in a class of T then it allows proper casting. I was trying to use a generic method in an existing Util class.
Thank you.
|
|
|
|
|
Hello
i need allow a form to resize only till some of its inner component has reached
a determined distance from each other, but still allow the form to be enlarged again.
I've put some code inside layout event, which assign the older size to the form if the conditions are verified.
the problem is that i see the form border blinking inside the form area when i try to
shrink the form utterly.
how can i avoid this effect?
thanks in advance
Stefano
|
|
|
|
|
I can't figure out what you're asking. Maybe you can clarify your question a bit?
Best,
Jun
|
|
|
|
|
Hello
thanks for answering and forgive my bad english. I'm tring to do the following:
private void on_layout(object sender, ...)
{
int newwidth = this.width;
int newheight = this.heigth,
suspendlayout...
if(right side of button1 < left side button2 || newwidth > actualwidth)
{
actualwidth = this.width;
}
else
{
this.width = actualwidth;
}
...
}
the problem is the form borders are visible inside the form area , when i'm in the else block, trying to reduce the window size. that's the effect i would avoid.
I'm sure i'm using the wrong approach and i need some suggest to me how to solve this problem.
Thank you
S
|
|
|
|
|
You can set a minimum size on a form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I want to move MS Agent Character to a control like Button or PictureBox etc. But MS Agent takes Screen position to move. How can I get the screen position of a control dynamatally as user may resize the form and screen position of a control changes. First, I thought of getting the property named "Location" of a control but, Location varies if the control is within a groupbox or panel. Moreover, Location doesn't say Screen position.
Please help.
Thanks
|
|
|
|
|
Try the PointToScreen method of the parent control:
Point screenCoordinates = this.PointToScreen(button.Location);
I'm assuming the control (button) is owned by the form itself, if owned by a GroupBox for instance then it would be:
Point screenCoordinates = groupBox1.PointToScreen(button.Location);
|
|
|
|
|
|
Hi All,
What is the best book (or resources) for exam # 70-316 'Developing Windows-based Applications with Visual C# .NET'?
Thanks in Advance
Jonny
|
|
|
|
|
The book I personaly like is "Beginning Visual C#" by "Karli Watson"
ISBN: 0-7645-4382-2
Its published by Wrox publications.
You can buy this book online from their website wrox.com.
Mujtaba
|
|
|
|
|
I am currently generating an image in DirectX using things such as Line.Draw() etc. and I need to get the image out as a bitmap. I Have managed to accomplish it using SurfaceLoader.SaveToStream(ImageFileFormat.Bmp, _surface0); however, this is too slow, I need something I can do in real time. Does any one have any suggestions for another way to get the image from a DirecX surface to a bitmap?
|
|
|
|
|
I need to transfer large chunks of data ( audio data actually ) between two systems in a LAN. Which method would be more time efficient. Remoting or TCP.
Thanks a lot.
|
|
|
|
|
Definitely TCP (or UDP). Remoting has overheads.
Best,
Jun
|
|
|
|
|
Apples and oranges, i.e. not competing technology to weigh against each other, Remoting is a technology that runs on top of a TCP stack so performance wise you are always going to get better performance the lower down the networking stack you go at the sacrifice of convenience and safety.
I.E. tcp is faster but you have to write a lot more code yourself. Remoting is mostly applicable when you are working with business objects.
|
|
|
|
|
|
Hi
I have a tricky requirement for checking for a particular data existance in the Excel file on the Cell[m,n], this I should verify when ever I try to lauch any excel file then my application (addin or what ever etc., ) should look for this criteria for existence of the particular data on particular cell then open the excel file in EXCEL.exe application.
Does any body as any clue, on how to implement this. I tried some different methods by writing Excel addins using C# but the success is limited to controlling and customising the frame-work (Menu, Commandbar, ToolBar etc. of EXCEL.exe)and could not able to intercept the events of excel file and could not intercept the data in the excel file which is being tried to open. Here the excel file is not a particular file, this data existence criteria should work for which ever the excel files we choose to open.
Please share if anybody has any details on this, would be a definite help.
thanks,
-Ram.
-Ram.
-- modified at 2:08 Thursday 21st September, 2006
|
|
|
|
|
lo,
i can sort in one column named name but what do i write to have every column in my table?
private void btn_sort_Click(object sender, EventArgs e)
{
db1DataSet.tabel1.DefaultView.RowFilter =" name LIKE '%" + txt_sort.Text + "%' ";
dataGridView2.DataSource=db1DataSet.tabel1.DefaultView;
}
i dont know how many tables there will be in the futur could be more then 100
there most be something to mark all the tables
thx
|
|
|
|
|
byte*
void*
unsafe
Thanks!
|
|
|
|
|
Dim byting_into_void As unsafe?
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|