|
Read this[^] article, you will get your answer.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
hi....
I want to access CABdb database file(.dbc) in C# and read the contents of the .dbc file. So how can I achieve this in C#3.0.
Thanks in advance.
|
|
|
|
|
|
I am not sure exactly which file type you are referring to but your best approach is always to try this[^] first.
It's time for a new signature.
|
|
|
|
|
Hi,
I am making an application integrated with Microsoft Project in c#. Now ,I want to read mpp file and convert all task objects to DTOs. I created DTOs same as Task object. The application should read any Microsoft Project version (from MS 2003). I used the normal methods creating the ApplicationClass object, reading the Project object, then iterating the tasks etc. Found it is too slow and OS dependent. I cant quit the Winproject.exe from my application in Win 2003 server. Also the application doesn't works on 64 bit OS.
Please guide me to a solution. Hoping a reply...
I had already posted this thread one month before. But didnt get any answer.
Regards,
DJ
|
|
|
|
|
|
Does anybody know what the equivalent C# code is for this C++ code :-
this->label1->Text = Convert::ToString( nums[1] );
|
|
|
|
|
this.label1.Text = nums[1].ToString();
modified on Monday, July 19, 2010 12:23 AM
|
|
|
|
|
To get identical behavior you should also use the Convert.String method in the converted code since that's just a framework call and not syntax:
<pre>this.label1.Text = Convert.ToString( nums[1] );</pre>
David Anton
Convert between VB, C#, C++, & Java
www.tangiblesoftwaresolutions.com
|
|
|
|
|
I want to draw polyline and smooth it. I use a WPF technology. How can I solve this problem. We hope to receive assistance.
|
|
|
|
|
This is actially not the best forum to get WPF related answers.
Next time, use the WPF forum.
To draw polygons in WPF, see here[^].
|
|
|
|
|
Thanks for your help. But maybe that's not what I need. I want to draw a Polyline when the mouse moves over a canvas. Add Point when the mouse is moved, the connecting point with the Linesegment together, and add the LineSegment to Pathgeometry. Then use Drawingcontex.DrawGeometry to draw. But polyline obtained not smooth as expected and when the mouse is moved quickly add points to the Polyline very far apart. I can not solve this problem. Hope to get help. Thanks a lot
|
|
|
|
|
I have a created a database by the name of ABC. I want to copy the employees table from the northwind database to my database. Whats the best way to do it.
Can someone direct me to a useful link or let me know how to do it dynamically.
|
|
|
|
|
Use SQL Server Management Studio SSMS.
SQL 2008 (earlier are similar)
Click on the database (ABC)
select tasks
select import data
follow the wizard
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
That does not sound very C#-ish
|
|
|
|
|
I am trying something like this, but its not very accurate
SqlDataAdapter da;
DataSet ds = new DataSet();
string conString = @"server = .\sqlexpress;
integrated security = true;
database = northwind";
da = new SqlDataAdapter("select * from employees", conString);
da.Fill(ds);
DataTable table = ds.Tables[0];
string conString2 = @"server = .\sqlexpress;
integrated security = true;
database = ABZ";
string commandString = "Create table Employees ( ";
SqlConnection con = new SqlConnection(conString2);
DataTable tab = new DataTable("Employees");
foreach (DataColumn column in table.Columns )
{
commandString = commandString + column.ColumnName + " " + column.DataType + " " + "nvarchar (50), " ;
}
I can make a switch statement for the data type. But the maximum size of the data always shows up as -1
|
|
|
|
|
If they're on the same server you can use a SELECT statement to create a new table with the contents you want.
|
|
|
|
|
|
Thanks in advance, as that was the second part of my problem, to copy the data once the table has been copied. The first one was to copy the table itself, still looking for an answer.
|
|
|
|
|
So you didn't look into using a SELECT to create and populate the table?
|
|
|
|
|
I was trying something like this
SqlDataAdapter da;
DataSet ds = new DataSet();
string conString = @"server = .\sqlexpress;
integrated security = true;
database = northwind";
da = new SqlDataAdapter("select * from employees", conString);
da.Fill(ds);
DataTable table = ds.Tables[0];
string conString2 = @"server = .\sqlexpress;
integrated security = true;
database = ABZ";
string commandString = "Create table Employees ( ";
SqlConnection con = new SqlConnection(conString2);
DataTable tab = new DataTable("Employees");
foreach (DataColumn column in table.Columns )
{
commandString = commandString + column.ColumnName +" nvarchar (50), " ;
}
commandString = commandString + ")";
SqlCommand cmd = new SqlCommand(commandString, con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("Table Created");
But the prob was I was getting a -1 value for column.MaxLength when I was trying this
foreach (DataColumn column in table.Columns )
{
commandString = commandString + column.ColumnName +" nvarchar (" + column.MaxLength + "), " ;
}
But how do you suggest I use the Select statement?
|
|
|
|
|
A statement like SELECT * INTO JunkCopy FROM Junk.dbo.JunkName will copy a table and it contents.
To add rows thereafter, a statement like INSERT INTO JunkCopy SELECT * FROM Junk.dbo.JunkName , but probably with a WHERE CLAUSE to avoid duplicates, should do the trick.
But these will only work when the databases are on the same server or in linked servers.
I have also had to copy tables among different database systems with code similar to (but infinitely better than ) the code you posted.
|
|
|
|
|
Thanks a lot that did the trick. That was what I was looking for.
Select * into
|
|
|
|
|
|
Hi,
I am trying to validate a xml document against xsd in c#. I used the code
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
And i get the following error.
TesterSchemaValidator.settings' is a 'field' but is used like a 'type'
Please help me, why i am getting this error.
|
|
|
|