|
Is there anyway to pull data from microsoft money into a C# application? If anybody knows how or has any good resources for me, that would be greatly appreciated.
JGA
|
|
|
|
|
|
I don't know if I can connect to microsoft money using oledb, how would I find that out?
JGA
|
|
|
|
|
I want to do this in .net v2 beta 2 with c#, does anyone know how to do this?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
What's wrong with Directory.CreateDirectory() ?
mav
|
|
|
|
|
THX
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Example,
Is this what you meant???
System.IO.Directory.CreateDirectory(@"D:\NewFolder\NewSubFolder")
Regards,
Mahesh
|
|
|
|
|
Hi!
I need some help with how to save a bunch of strings into an ANSI-text file and not the standard UTF-8. The reason for this is that the application that uses this text file does not like UTF-8 when a special character is involved (like Swedish åäö etc). Does anyone have any good ideas or sample codes out there to save a file into ANSI instead of UTF-8?
|
|
|
|
|
Hi!
When you create a FileStream you can specify an encoding to use. There you can use Encoding.ASCII to get non-UTF8 text files.
mav
|
|
|
|
|
As usually... It was too easy. Tank you very much .
|
|
|
|
|
CultureInfo culture = new CultureInfo("el-GR");
int codePage = culture.TextInfo.ANSICodePage;
Encoding GreekEncoding = Encoding.GetEncoding(codePage);
then at this line :
new StreamWriter(destinationpath, false, GreekEncoding);
|
|
|
|
|
I try to get some data from a .mdb file, but it fails with a realy weird and long exception, here is my code:
public DataSet getTranslation(int language)
{
DataSet translations = new DataSet();
String connes = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Documents and Settings\\Johan\\My Documents\\languageDB1_00.mdb";
String sql = ("SELECT Translation, PhraseKey FROM Translation WHERE languageID = " + language + ";");
OleDbConnection conn = null;
conn = new OleDbConnection(connes);
//"SELECT Translation, PhraseKey FROM Translation WHERE languageID = " + language + ";";
try
{
OleDbCommand command = new OleDbCommand(sql, conn);
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
conn.Open();
adapter.Fill(translations, "Translation");
return translations;
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.ToString());
return null;
}
finally
{
conn.Close();
}
}
The exeption message begins with:
IErrorInfo.GetDescription failed with E_FAIL (0x80004005)
please help...
john
|
|
|
|
|
Hello John,
The problem is because of the usage of the keyword "Translation" as in OLEDB.
If you change the SQL to
String sql = "(SELECT [Translation], PhraseKey FROM [Translation] " + <br />
"WHERE languageID = " + language + ")";
the snippet will work fine.
Regards
Mahesh
|
|
|
|
|
Hello folks,
i'm not a C# expert so i have a question to do.
I want to fetch the external ip of a machine whin is linked at a router.
All the HowTo i have seen didnt help me
If anyone can help I would be grateful.
Thanks
Enrico
|
|
|
|
|
I want to draw a triangle on the end of a line (vector).
I know how to do it brute force. Is there a better way?
Thanks a lot...
|
|
|
|
|
How would we know what "brute force" is to compare it to a better method? You have to post some code or supply some explanation of how you're doing it now. Also, the "best way" depends on the situation that the code is being used in. Do you need to draw this triangle in a certain position all the time, does it have to function as an arrow pointer, following the slope of the line? ???
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Point taken.
What I want is a triangle at the end of a line just as in the hands of a clock (it's not a clock).
By by "brute force", I meant a set of 3 connected points
Placed at the other end of the line.
|
|
|
|
|
Have you looked at the LineCap's of a Pen? Click[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Wow. I had no idea.... thanks. Not to get too greedy here, but is it possible to use it for the
technique here? Or will I have to re-write most of it.... thanks again
/////////////////////////////////////////////////////////////////////////////////////////////////////
public Pen[] activePen = new Pen[] { new Pen( Color.Blue, 2 ), new Pen( Color.Green, 2 ), new Pen(Color.Red, 2) };
private int _penIndex = -1;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
private Pen GetNextPen()
{
_penIndex = (_penIndex + 1) % 3;
return activePen[_penIndex];
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
g.DrawLine(GetNextPen(), 250, 250, x, y );
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
Sure you can, but you will have to initialize the array of Pen somewhere else (for example in the constructor):
private Pen[] activePen;
public MyClass() {
activePen = new Pen[] { new Pen( Color.Blue, 2 ), new Pen( Color.Green, 2 ), new Pen(Color.Red, 2) };
activePen[0].EndCap = System.Drawing.Drawing2D.LineCap.Round;
activePen[1].EndCap = System.Drawing.Drawing2D.LineCap.Triangle;
activePen[2].StartCap = System.Drawing.Drawing2D.LineCap.Triangle;
activePen[3].EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
}
Now all your pens have different kind of caps. You can als play around with the other properties of the Pen (like Dash...). You should also look at the CustomeStartCap/EndCap properties. With them you can define special caps (if needed).
|
|
|
|
|
Hello,
in the help it says Varchar of the Type OleDBType is mapped to string of the .Net framework. How can i get this information if i have the OleDBType? because i can't find it anywhere this information.
greetings
Sander
|
|
|
|
|
Get what information?
The .Value of the OleDbParameter object? Easy, look at the .Value property.
What the OleDbTypes map to? This map doesn't exist in code. There are no hard-and-fast rules that "map" an OleDbType to a .NET Framework type. For example, you could read a database integer type into many types in the .NET Framework, depending on how you're using the data, an integer, single, double, byte, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
System.Data.DataTable tableSchema = Connection.GetOleDbSchemaTable( System.Data.OleDb.OleDbSchemaGuid.Columns, new object [ ] {null, null, t.name, null} );
System.Data.DataView dVTableSchema = new System.Data.DataView(tableSchema);
dVTableSchema.Sort = "ORDINAL_POSITION ASC";
for (int i=0; i < dVTableSchema.Count; i++)
{
int dataNumber = (int) dVTableSchema[i]["DATA_TYPE"];
System.Data.OleDb.OleDbType columnType = (System.Data.OleDb.OleDbType) Enum.Parse(new System.Data.OleDb.OleDbType().GetType(), dataNumber.ToString());
okej i have now the columType but know i wanna know how i can read the mapped .net type and i'm not using any oledbparameters.
greetings
Sander
|
|
|
|
|
There is NO MAPPED TYPE! The data can be moved to ANY .NET Framework value type.
The "mapping" is a set of guidelines, not a direct one-to-one relationship between the database type and any .NET Framework types.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hmm that sux because i need the base type so i need to translate it my self?
|
|
|
|