i need to call a c# code in my java program. i followed the approach given in the codeproject link: http://www.codeproject.com/KB/cross-platform/javacsharp.aspx but there are some issues in generating netmodule , which is required to perform further steps. but it is giving an error
"csc /debug /t:module "bin\Debug\\HelloWorld.dll"" exited with code 9009 on using post build event command line.
E:\c#\getOLCont\getOLCont>csc /t:module form1.cs
the error is:
fatal error CS0009: Metadata file 'c:\Program Files\Reference
could not be opened -- 'File is corrupt.'
i have tried the command on different machines but there is same result.
HI, I want to iterate only those rows of excel sheet where the data have written, means if user has filled only first 15 rows then my loop should iterate to 15 only,hO wcan i do that Below is sample code which iterates up to 65536 rows,unnecessarily ,but the data are present only in first 15 or 18 rows. Please give me a solution or an idea
This is my sample code
Microsoft.Office.Interop.Excel.Application Excelobj = new Microsoft.Office.Interop.Excel.Application();
if (Excelobj == null)
MessageBox.Show("Excel couldn't be started", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
i want to create crystal report for access(password protected)database.i do it bu this project run another computer error messege come loginfo.
please help.i want to diploy database datadirectory.i using visual studio 2005 exprees editon.(crystal report for .net framewort 2)
get more example.because i am biginner
I would suggest you buy a beginner book and work through it, start with someting simpler, then work up to this. If you're being paid to do this, let your client know they made a poor choice and they should move on.
No longer a Microsoft MVP, but still happy to answer your questions.
Hi i am sending mail to different ids...,
Everything going on well....,
I am going to make this application to exe and put it in schedular task...,
This things will execute automatically...,
Now my probs is suppose mailserver is down...,
Then it will be probs in mailsend...,
So in that case how to handle the code.., it mean if the mailserver will down or mail didnt send properly...,
Then it have to be fire again, after some minutes or some other condition have to do how to do that?
This is my code:
DirectoryInfo dInfo = new DirectoryInfo(mypath);
DirectoryInfo dInfos = dInfo.GetDirectories();
foreach (DirectoryInfo d in dInfos)
MailMessage mailMessage = new MailMessage();
MailAttachment attach = null;
mailMessage.From = "Magesh@Test.com";
mailMessage.To = d.Name;
mailMessage.Subject = "Hi";
//mailMessage.Body = "Hi This One Is For Testing
FileInfo fInfos = d.GetFiles();
foreach (FileInfo f in fInfos)
attach = new MailAttachment(f.FullName);
mailMessage.To = "";
attach = null;
Thanks & Regards,
please don't forget to vote on the post
I'm using the following code to roundtrip a value between one Int64 var and two In32 vars.
public static Int64 Int64FromPersistentIDs(int highID, int lowID)
return (((Int64)highID << 32) + (Int64)lowID);
public static void PersistentIDsFromInt64(Int64 longID, ref int highID, ref int lowID)
lowID = (int)(longID & 0xFFFFFFFF);
highID = (int)((longID >> 32) & 0xFFFFFFFF);
This code roundtrips well when highID is positive, and when highID is negative and 9 digits, but it fails as soon as highID is negative and 10 digits - the highID comes back as off by one (one too large).
The following High / Low combination: -1173074781 / -1181223073
was round-tripping back as -1173074782 / -1181223073
(note the High Order output is one more than the input.)
I determined that that code which builds the 64bit INT was the culprit, here's why. These IDs are passed to me by an application that actually stores a 64 bit number in it's XML database. However, instead of passing me the 64bit number, it passes me two 32 bit numbers.
I looked inside the database for the record I was querying, and the 64bit number stored there is: BA144CA3B997F75F
But my code (return (((Int64)highID << 32) + (Int64)lowID)) was returning BA144CA2B997F75F (note the difference at the 8th digit - the 2 should be a three)
So I was getting a bad 64 bit number from my code. I changed my units to UInt64, and my code started returning a 64 bit number which matched that number stored in the database.
I don't know exactly why it was failing, but I could tell it was a "size" issue, because some inputs were returning the correct 64 bit numbers (as validated in the database), and some were not.
I read data from a database to dataset and diplay it in a datagrid.
Now I want to update database from xml file
First I read update xml file: dataset.ReadXml(fileName);
Now I update database with dataset: