|
Hi all,
One System having Oracle database with RH Linux OS. in one more system having WinXP OS.
I want to access Oracle database through WinXP System.
How can I achive this?
|
|
|
|
|
by magic... you need to make a magic incantation on oracle database with one of the magic stick (C#, Java, C++, etc) or with one of Oracle's free IDE (e.g. SQLdeveloper)... then you will be able to for feel you're destiny!!!
|
|
|
|
|
In the code how can we check for below errors
i) DB files not available
ii) DB is corrupted
iii) Driver errors.
|
|
|
|
|
Just try to access it and display an the Exception.Message if one is thrown -- what else would you try to do?
|
|
|
|
|
Hi Experts,
What i am trying to achieve here is a bit tricky. Let me brief on a little background first before going ahead.
I am aware that we can use a enum as a type to a parameter of a method. For example I can do something like this (a very basic example)
namespace Test
{
class DefineEnums
{
public enum MyEnum
{
value1 = 0,
value2 = 1
}
}
class UseEnums
{
public void UseDefinedEnums(DefineEnums.MyEnum _enum)
{
}
public void Test()
{
UseDefinedEnums(DefineEnums.MyEnum.value1);
}
}
}
What i need to do is create a dynamic Enum and use that as type in place of DefineEnums.MyEnum mentioned above.
I tried the following.
1. Used a method which i got from the net to create a dynamic enum from a list of strings. And created a static class which i can use.
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
namespace Test
{
public static class DynamicEnum
{
public static Enum finished;
static List<string> _lst = new List<string>();
static DynamicEnum()
{
_lst.Add("value1");
_lst.Add("value2");
finished = CreateDynamicEnum(_lst);
}
public static Enum CreateDynamicEnum(List<string> _list)
{
AppDomain currentDomain = AppDomain.CurrentDomain;
AssemblyName aName = new AssemblyName("TempAssembly");
AssemblyBuilder ab = currentDomain.DefineDynamicAssembly(
aName, AssemblyBuilderAccess.RunAndSave);
ModuleBuilder mb = ab.DefineDynamicModule(aName.Name, aName.Name + ".dll");
EnumBuilder eb = mb.DefineEnum("Elevation", TypeAttributes.Public, typeof(int));
int i = 0;
foreach (string item in _list)
{
eb.DefineLiteral(item, i);
i++;
}
return (Enum)Activator.CreateInstance(eb.CreateType());
}
}
}
2. Tried using the class but i am unable to find the "finished" enum defined above. i.e. I am not able to do the following
public static void TestDynEnum(Test.DynamicEnum.finished _finished)
{
}
I guess the post has become too long but i hope i have made it quite clear.
Why i need such a functionality?
I can very well make the method with string as a parameter. I need this so that the developer who is using the method need not have to remember the set of values, amongst which only 1 he should pass. He will directly get it through the enum which is being created dynamically.
Anyone Please help!
Thanks in advance!
Regards,
Samar
|
|
|
|
|
Hi Experts,
Any suggestions on this??
Regards,
Samar
|
|
|
|
|
Will generics solve the problem?
|
|
|
|
|
Any time you get some weird code from somewhere the best place to get answers when it doesn't work is to ask in the same place you got the code.
I don't really understand your goal. If your developers can't be relied upon to remember simple things then expecting them to use things like dynamic enums is probably a bad idea. Maybe if you gave an example of how it would be used we could give you an alternative. If the enum isn't built until runtime I don't see how it can give any advantage to someone at coding time.
|
|
|
|
|
Good day one and all,
I've been given a little task to create a petrol station app. The app allows for multiple "pumps" with the option of adding more petrol/gas pumps where required. Currently my app displays only one pump at a time and you change between pumps with a combo box.
Obviously in the real world you can have multiple pumps all running concurrently, so I wanted to duplicate the same form everytime a new pump class was created/instantiated.
Does anyone have a pointer on the simplest way for me to do this? A pointer to some code to look at would be ideal as I'm no coding guru at the moment.
Thanks all,
Mike.
|
|
|
|
|
Have you tried:
MyPumpForm newPump = new MyPumpForm();
newPump.Show();
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Cheers matey, that's getting me somewhere. I didn't think it would be quite that simple...
|
|
|
|
|
A problem with this is that if I close the first form that opens, it closes all subsequent ones.
|
|
|
|
|
I assume you mean "When I close the main form, all the other forms close."
Well yes. When you close the main form, the program terminates. This closes all the other forms. Look at the Main method in program.cs
If you have a pump form as your main form, then when that is closed, your app terminates.
Best solution: Don't make the pump form your main form. Have a fuel station form which opens all the pump forms. When you close the fuel station form, the app terminates.
Other solutions are rather more complex.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
I see the Force is with you today.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Use UserControls and TabPages instead of multiple forms?
|
|
|
|
|
Hi,
I want to fill the 2nd combobox with values dependent on the value from the first combobox
In reallife: The first combo contains car brands, the second a list of types. I want that when I select Ford I only get the types from Ford
private void GetVtgMerken()
{
txtBrand.DataSource = _Brand.GetVtgBrand();
txtBran.DisplayMember = "Brand_Name";
txtBran.ValueMember = "Brand_ID";
}
private void GetVtgBrandTypes(int ID)
{
txtType.DataSource = _Brandtype.GetVtgBrandTypes(ID);
txtType.DisplayMember = "type_Naam";
txtType.ValueMember = "MT_Id";
}
private void txtBrand_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = txtBrand.SelectedValue.ToString();
int ID = Convert.ToInt32(txtBrand.SelectedValue.ToString());
int ID = Int32.Parse(txtBrand.SelectedValue.ToString());
GetVtgMerkTypes(ID);
}
When I use Convert.toInt32 or int32.parse I always get the error like below.
System.FormatException: Input string was not in a correct format.
Textbox1.text displays the value correct (ex. 3)
Is there someone who can help ?
|
|
|
|
|
What's the value of txtBrand.SelectedValue.ToString() ? Check if it is really a number (meaning digits only) if it contains letters, you'll need to perform additional formatting or use another container then int for ID.
V.
|
|
|
|
|
When I do:
textBox1.text = txtBrand.SelectedValue.ToString()
the textbox shows the value "3".
An integer I think
But when I convert the textbox to an variable the debugger complains.
Kan een object van het type System.Int32 niet converteren naar het type System.Data.DataRowView.
After a long search i fixt it like this:
private void txtBrand_SelectedIndexChanged(object sender, EventArgs e)
{
if (txtBrand.SelectedValue is DataRowView)
{
string BrandID = Convert.ToInt32(((DataRowView)txtBrand.SelectedValue)["Brand_Id"]).ToString();
int ID = Convert.ToInt32(BrandID);
GetVtgMerkTypes(ID);
}
else
{
int ID = Convert.ToInt32(txtBrand.SelectedValue.ToString());
GetVtgMerkTypes(ID);
}
}
... this works
|
|
|
|
|
conversion methods will throw a FormatException when the input string isn't in the right format, which includes the case where the input is empty. e.g. you may get that while your Form gets loaded. It is often solved easily by including a non-zero-length test in your code.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Luc,
I think you are right !!!
I fixt it with the code below:
private void txtBrand_SelectedIndexChanged(object sender, EventArgs e)
{
if (txtBrand.SelectedValue is DataRowView)
{
string BrandID = Convert.ToInt32(((DataRowView)txtBrand.SelectedValue)["Brand_Id"]).ToString();
int ID = Convert.ToInt32(BrandID);
GetVtgBrandTypes(ID);
}
else
{
int ID = Convert.ToInt32(txtBrand.SelectedValue.ToString());
GetVtgBrandTypes(ID);
}
}
maybe not nice but it works
|
|
|
|
|
|
Translation: Oh crap ive had a bid accepted on rentacoder and I have no clue how to do it.
|
|
|
|
|
which translates back to:
hi,
i have to show a customized message in window media player when videos playing..it is a c# desktop application application...message can be video info author or any customized message by user..advance appreciate for help and advise..
regards
tanzeel;
I hate it when the OP gets removed while holding one or more replies.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi,
i have an existing C# application made in 2005, now we have converted
it into the 2008, now i want to design a from using WPF, and i want to
give it to the 3d look.
So how can i do this?
i am new for WPF.
|
|
|
|
|
A good startup tutorial for WPF 3D is available here.
Based on the size of your older app, this conversion may be a time consuming process.
My signature "sucks" today
|
|
|
|