|
Using RegMon I discovered that there seems to be some registry keys missing. The COM+ exporter is looking for the CLSID value in HKLM\SOFTWARE\Classes\NameSpace.Class\CLSID. Which doesn't exist for this component.
Why would that be the case? I've added it to the GAC and used regsvcs to register it with Component Services. Have I missed another step?
Thanks again for all your help.
Graham
|
|
|
|
|
SpudgunDoogal wrote:
Why would that be the case? I've added it to the GAC and used regsvcs to register it with Component Services. Have I missed another step?
Try generating a Type Library with regsvcs /tlb and registering this tlb by hand, see if it helps.
ORACLE One Real A$#h%le Called Lary Ellison
|
|
|
|
|
I'm writing a small application that needs to take a DataSet and dump it to either a Comma Delimited text file or a Tab delimited text file. I was wondering if there are any "proper" ways to do this, using built in functions or classes, or if I should just manually write out the proper format to a standard text file. Writing it out myself is trivial, but if theres an established way of doing this with .NET I would like to know.
Thanks
Dave Ratti
|
|
|
|
|
Nope, just a "proper" way to write it out to XML.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
|
|
By now you have probably already solved this problem, but just incase you havent I recently put the following code together to read a file as a dataset and vice versa :
public static DataSet ReadFileAsDataSet(string filePath, string fileName)
{
OleDbConnection oCon = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + filePath + ";" +
"Extended Properties=\"text;HDR=NO;FMT=Delimited\"");
OleDbDataAdapter oCmd = new OleDbDataAdapter(
"select * from "+fileName, oCon);
DataSet ds = new DataSet();
oCmd.Fill(ds);
oCon.Close();
return ds;
}
public static void WriteDataSetAsFile(string filepath, string fileName, DataSet ds)
{
if(File.Exists(filepath + "\\" + fileName))
File.Delete(filepath + "\\" + fileName);
StreamWriter sw = new StreamWriter(filepath + "\\" + fileName, true);
foreach (DataRow dr in ds.Tables[0].Rows)
{
object[] objRowData = dr.ItemArray;
string strRowData = string.Empty;
foreach(object obj in objRowData)
{
strRowData+= "\"" + obj.ToString() + "\",";
}
strRowData = strRowData.Remove(strRowData.Length - 1, 1);
sw.WriteLine(strRowData);
}
sw.Close();
}
|
|
|
|
|
|
i am looking for a grid control where i can display and edit data..there are no backend tables involved..
isnt the data grid control usable only if you bind it to a backend ?
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
The datagrid can be used with many things like a dataset, an xml document, etc. Or you can just load it up yourself.
|
|
|
|
|
ok thanks..will try and let you know..
i had taken a cursory look at the datagrid's members and somehow had the notion that the bind was mandatory..
There are no failures; there are only extended learning opportunities.
|
|
|
|
|
I need to Export Fields in a table into another Database Table on a Remote machine, at the moment I Export the records one by one and delete the records as I go along. This is very slow over a 28k connection that I need to use.(3 records per second or so, I am dealing with 1000s of records)
I would love to take all the records at once, dump the on the remote machine and then delete the lot!
I can make use of a Dataset to get all the records but how do I specify what and how to export this to another connection???
Leon v Wyk
|
|
|
|
|
Well, a DataSet can be written to an implementation-independent XML file using DataSet.WriteXml() . Since DataSet is also marked with SerializableAttribute and implements ISerializable , you can serialize this normally to a file yourself. It also derives from MarshalByValueComponent , which means that you can use it in remoting as a remote, pass-by-value object. See the documentation for DataSet for what else is available.
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
Doing them in a set wont speed anything up more for you. Best is to perhaps export the table to a temporary access database, zip the file , send it to other side, etc ,etc. Access tends to compress very well.
Leon v Wyk wrote:
at the moment I Export the records one by one and delete the records as I go along. This is very slow...I am dealing with 1000s of records
I can picture that
leppie::AllocCPArticle(Generic DFA State Machine for .NET);
|
|
|
|
|
Hi, I want to add a new row to a datatable, which I have done. It works perfectly. I then did the dataTable1.AcceptChanges() in the belief that it would save my changes to the database. It did not do this, does anyone have any ideas how to do this?
|
|
|
|
|
Did you add the row back to the rows collection and call Update on the dataAdapter? The code should look like this:
DataRow row = dataTable.NewRow();
row["Column1"] = "blah";
row["Column2"] = "blech";
dataTable.Rows.Add( row );
dataAdapter.Update( dataSet, "TableName" );
dataSet.AcceptChanges();
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
ok the application config xml file is great for applications but what if I create a namespace / class that will be compiled as a dll and used in other application, where would or rather should I stick it configuration "defaults" in the host application config xml file or should it have it's own file?
Thanks
Rob
|
|
|
|
|
Definitely use the 'configuration "defaults" in the host application config xml'. In general, if you are building a separate dll for binary re-use, you probably don't want the library (dll) itself to ever be concerned about application level settings and serializing them. Even if they are settings specific to the dll, they are settings that will be collected from the user in whatever application you are using and then passed into whatever objects you use from the dll upon instatiation.
You can also use the registry to store the values from your main app. Then, when you want to use an object from your dll, pass in the values after obtaining them back from the registry (or XML) to the object constructor.
Hope that makes sense.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
I built a console app for testing. Is there a simple way to get
Console.WriteLine("Hello World");
to print to the IDE Output window rather than the Console window?
|
|
|
|
|
Try
Debug.WriteLine("Hello World");
... and don't forget the
using System.Diagnostics;
|
|
|
|
|
I wrote my own command in Crystal Reports 9, I want to set the DataSource at runtime.
StaffHoursReport staffHoursReport = new StaffHoursReport();
foreach( Table t in staffHoursReport.Database.Tables )
{
t.SetDataSource( Db.DataSource );
}
Where Db.DataSource is a static string. It works for all the tables in my Report but not for the Command I made. I also tried
t.Location = Db.DataSource;
but this works for all the tables but throws an exception on any Commands. The SetDataSource does not throw any exceptions but it prompts for the database path when the report is being created for display. And then it says log in failed if i type in the path to the database.
The only way this report works is if I have the database in the path specified in the report designer. But this is no good, it will be on different machines all the time.
Please help, thanks alot.
|
|
|
|
|
public class Class2
{
private Class1[][] var;
public Class2
{
var = new Class1[9][]
{
new Class1[9]
{
new Class1(.....),
new Class1(.....),.....
},
new Class1[9]
.....
}
}
}
when i debug this, there's an Exeption at the underlined position: Invalid Parameter used
What did i wrong?
|
|
|
|
|
Frankly, I haven't done a whole lot with multidimensional arrays in C#, however, I can say this--the syntax you are using looks really strange and I'm not sure what you are trying to accomplish. I don't know if the code you have provided here is just pseudo-code or the real thing, but as far as I can tell, you have all kinds of problems. Here's how I interpret your code, but with a more conventional syntax:
public class Class2
{
private Class1[][] var;
public Class2()
{
var = new Class1[9][];
var[0] = new Class1[2];
var[0][0].Member1 = "Bob was here";
var[0][0].Member2 = "Testing...testing";
var[0][1].Member1 = "Is this thing on?";
}
}
Looks to me like you just have a syntax problem. If you'll explain exactly what you are trying to do, I can help a little more. I am just trying to provide you with proper syntax here.
Good luck.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Replace the underlined line with the following:
var = new Class1[][]
|
|
|
|
|
Hi,
I'm currently trying to develop a COM+ server component which receives data passed to it by a client and stores that data into a database. So far I have the client talking to the server but nothing appears to happen. Watching the component in the Component Services reveals that the object is being created and is pooling as expected. Yet it doesn't appear to do anything else. When I run the code in a standalone version it does the job perfectly! Can anyone help me to figure out what I'm missing?
Thanks in advance.
Graham
|
|
|
|