|
reverse compile it and port to J# would be one way, dont know of any other, never done it
regs,
g00fy
|
|
|
|
|
|
Iam trying to buid an online forum .(the onw which looks like this forum for example)
I want to know how to do it?
plz help me..
venkat
|
|
|
|
|
There are a couple of good open source packages available. Start by having a look at those, then decide if such a project is still worth your time. If so, you'll have some good samples to work with. Is this for a company, or a varsity project?
|
|
|
|
|
( C# 2003 ) I have two relational Tables in the DataSet. Say Parent and Child. Now the problem is when I display the dataTable in DataGrid from Parent it Keeps the + Sign with each row and on clicking that you can see the child table records related to that record. What I want is the following
display the record without plus sign and since my table has ONE TO ONE Relation so I need to display the fields from both the tables in one line like
ParentField1 , ParentField2, ChildField1,ChildField2 in one row.
I have tried to work on DataView but may be Dont know how to work on.
Can any one please guide me or refer me to any solution.
|
|
|
|
|
You have to create computed columns in the parent table:
parentTable.Columns.Add("ChildField1", typeof(int), "Max(Child(RelationName).Field1)");
ChieldField1 is the name of the new column.
The type must be set to the type of the child column.
RelationName must be the name of the relation between parent and child table.
Field1 is the name of the child column you are referring to.
The Max is needed because there COULD be several childs existing for a single parent (you could also write Min, which would have the same effect when having a 1to1 relation).
For details about using expressions in DataColumn refer to this page.
|
|
|
|
|
Hello,
I am trying to write a simple console app that reads the data contained in specific Excel spreadsheet cells, and use that data to write an .xml file with the XmlTextWriter class. when I go to compile the code, I get an error that says it does not recognise 'using Excel;' and that I may be missing a reference. The thing is I had already added the Excel reference from the Project > Add Reference.. dialog. I run into this error before when writing to an Excel worksheet and after I clicked 'Yes' to continue in the 'Build Errors' dialog, the app ran perfectly, but not this time.
I now get an error that says VS cannot start debugging beacuse the debug target <path>\Program.exe is missing. I have never seen this before, can anyone help me?
The code below is an extract on my class:
class Program
{
static void Main(string[] args)
{
//directory of XLS file to be read from
string xlsDir = "";
bool xlsError = false;
XmlTextWriter writer = new XmlTextWriter("C:\\My Documents\\test1.xml", _UnicodeEncoding);
writer.Formatting = Formatting.Indented;
int countVPS = 0; //to increment the VPSnodes array
string[] VPSnodes = new string[5] { vendorID, vendor, copyright, version, _schemaVersion };
//opens dialog to browse directories and open a file
OpenFileDialog openFile = new OpenFileDialog();
openFile.InitialDirectory = "c:\\My Documents";
openFile.Filter = "xls files (*.xls)|*.xls*|xml files (*.xml)*.xml*|
_All files (*.*)|*.*";
if (openFile.ShowDialog() == DialogResult.OK)
{
xlsDir = openFile.FileName;
Excel.Workbook wb = this.Application.Workbooks.Open(xlsDir);
// activate the active worksheet in the workbook
(Microsoft.Office.Interop.Excel._Workbook)
_this.Application.Workbooks[1]).Activate();
((Excel.Worksheet)this.Application.ActiveWorkbook.ActiveSheet);
try
{
if (ExcelObj == null)
{
Console.WriteLine("\nERROR: EXCEL couldn't be started!");
xlsError = true;
}
if (xlsError == false)
{
writer.WriteRaw("<vps>");
writer.WriteStartElement("vendorProductSet");
for (int colV = 1; colV <= 5; colV++)
{
writer.WriteAttributeString(nodes[countVPS],
_((Range)ws.Cells[2, col]).Value2);
countVPS++;
}//end VendorProductSetNode
}//end if
writer.Close();
}//end try
catch (Exception e)
{
Console.WriteLine(e);
}//end catch
}//end if
}//end main
}//end class
|
|
|
|
|
Hi,
I am storing description of few forms in a .DEF file(text file). The .Def file is in a particular format and each form description is stored under a particular heading say for Eg. FORM1, FORM2, FORM3. Now after a particular form is edited say FORM2, I will have to rewrite the entire block of text under the header FORM2 which is nothing but a string . What is the best way to rewrite a particular block of text ?
Thanks
Bharath
|
|
|
|
|
Afaik there is no straight way to do it, because unless the length of those blocks are always the same there would be the need to move everything coming after the exchanged block of text (which would mean to write the whole file again if you were exchanging the first block).
But unless you aren't talking about several thousand lines of text you should probably just write everything when needed. The performance overhead shouldn't be that much.
Another method would be to store your infos in several files (one for each form).
|
|
|
|
|
|
Yes. Its the description of XFS forms
Thanks
KR
|
|
|
|
|
I have created a custom action(windows application) and then added a setup and deployment project to install this.
I need to return custom errors when the msi is executed using MSIEXEC.exe.
Can anyone help me regarding this?
Regards,
Lata Agrawal
|
|
|
|
|
Hi
I have a problem using OleDbDataAdapter and DataSet in a C# windows application and MS Access 2000 database. The primary keys use AutoNumber/IDENTITY columns.
In the DataSet I load two tables from the database (a parent and a child table).
I add an event handler to the dataAdapter:
adapter.RowUpdated += new
OleDbRowUpdatedEventHandler(DataAdapter_OnRowUpdate);
private static void DataAdapter_OnRowUpdate(object sender, OleDbRowUpdatedEventArgs e)
{
OleDbCommand oCmd = new OleDbCommand("SELECT @@IDENTITY", e.Command.Connection);
e.Row["MachineIndex"] = oCmd.ExecuteScalar();
e.Row.AcceptChanges();
}
When I insert new data into the parent table in the DataSet and update the database the above-mentioned event handler returns the correct newly inserted AutoNumber column value. However when I update an existing row in the datatable in the DataSet and update the database, the value returned is 0 (zero) and then the index of that row in the DataSet shows 0.
Can anyone give me some assistance regarding this problem.
Thanks.
Kobus
|
|
|
|
|
The @@identity property is only set when a record is created, not when a record is updated.
---
b { font-weight: normal; }
|
|
|
|
|
Hi, When I scale on C# (using Matrix.Scale), the anchor point is the top left of the graphics. How can i make it so the center point of the scaling is arbitrary (for example the mouse pointer)?
|
|
|
|
|
hi all,
can someone please give me some idea of how to do remoting using custom objects?
all tutorials ive seen are passing strings or datasets, but i want to pass an object that is not inherintly serialisable. (i know i have to serialise it ... but ...)
i have also looked at serialising objects but all info ive seen are about serailising the object to file or xml, but i just want to squirt it down the wire, once i get the object at the client i serialise it there to database.
can anyone please give me a link or small example or something as its driving me crazy trying to work it out
kind regards,
g00fy
|
|
|
|
|
For serialization have a look at this article. It explains the basics very well.
Once your class is serializable remoting should work fine.
|
|
|
|
|
thank you again
i used datasets for the previous problem but i have another remoting application that will use object passing. i will look into it
kind regards,
g00fy
|
|
|
|
|
Hi
I have a filled TreeView and a I have to select a Node in this TreeView. I know the path to select it, but how can I make a selection in this TreeView?
"FullPath" is ReadOnly
Thanks a lot for help
Greets
Michael
|
|
|
|
|
Hi!
Just set the SelectedNode property.
Regards,
mav
|
|
|
|
|
Dear All,
I run a squid server on WinXP (127.0.0.1:8081).
I have a C# application that I want to it redirect ALL HTTP request to squid.
(application and squid run on one system)
I use GlobalProxySelection and below code in my application, but dont work.
Uri proxyURI = new Uri("http://127.0.0.1:8081");
GlobalProxySelection.Select = new WebProxy(proxyURI);
How can I redirect ALL http request to this proxy server?
--TNX
|
|
|
|
|
Why does Double.NaN != Double.NaN
ie, this fails
double d1 = Double.Nan;
double d2 = Double.Nan;
System.Diagnostics.Debug.Assert(d1 == d2);
|
|
|
|
|
|
Read my question.
MSDN says
Use IsNaN to determine whether a value is not a number. It is not possible to determine whether a value is not a number by comparing it to another value equal to NaN.
I already know that. I am asking why.
|
|
|
|
|
Is a not defined number equal to another one?
Is 2/0 equal to 3/0?
Intuitively seen (probably) yes, but mathematical: No!
Double.NaN is mathematically not existing so it isn't equal to anything (including itself).
|
|
|
|