|
Yes. Tell your professor that you are going to make a better version of Mathematica. I'm fairly certain that will keep you fairly busy for 6 months-ish
|
|
|
|
|
5 and a half months dithering followed by two weeks frantic posting: "Nd Mathematica Cd. Urgentz."
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
What doubts do you have and why?
|
|
|
|
|
|
Well basically I am creating a visual studio addin at the moment in c#. I have looked everywhere that I could think of for the answer to this, but have yet to find the answer. All I am looking to do is handle certain events from DTE2, like build events, solution events etc. But yet when I do it the way that I would think it should be done, the functions for the events never get called in my code.
Example of what I got so far:
private BuildEvents _buildEvents;
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
_buildEvents = _applicationObject.Events.BuildEvents;
_buildEvents.OnBuildBegin += new _dispBuildEvents_OnBuildBeginEventHandler(_buildEvents_OnBuildBegin);
And then of course I define the function:
void _buildEvents_OnBuildBegin(vsBuildScope Scope, vsBuildAction Action)
{
MessageBox.Show("Building");
}
And then I remove the event in the disconnect code. But like I said it never gets called. I have even tried other events like open solution but same case.
Thanks
|
|
|
|
|
i m getting error
'Error HRESULT E_FAIL has been returned from a call to a COM component.'
help me with the solution.
|
|
|
|
|
It is a very generic error message. Not much help can be offered from this. All I can say is that there is some error in the COM component's method you had called.
Take a look at this[^] blog. It might help.
|
|
|
|
|
I was wondering if you can print a report without the report viewer?
Right now, a user can right click the ListView and select View Ticket and it will bring up a Windows Form with a report viewer in it (linkd to TicketView.rdlc) and it will view the printable version of the ticket.
Now on the same context menu I put a Print Ticket button. My intensions was the user can view the ticket in printable format then print it, or the user could just click the Print Ticket button and it would print it exactly like you would view it in the report viewer.
Right now my ViewTicket.cs (Windows Form) has the dataset, binding source, and table adapter. When this form is opened, the ID (SQL) is passed to the windows form. Then we fill the table adapter using the ID. Now my other forms didnt do it this way since they needed more input before viewing the report. It seemed when I tried this with the forms Load event it wouldn't work.
Here is how I passed the parameters during the Loading of the form (this DIDNT work)
ReportParameter[] parm = new ReportParameter[1];
parm[0] = new ReportParameter("ID", ID.ToString());
reportViewer1.LocalReport.SetParameters(parameters);
reportViewer1.RefreshReport();
Now this exact code would work if I put a button on the form and ran this code during the button click event. But its like the report can't refresh because the form is loading maybe? Not sure..
Anyways, so how exactly could I print this report without going to the report viewer? I understand I would need to pass the ID to the report still, but how do I skip the viewing the report with the reportviewer and printing it from there? How can I just go straight to printing the report with one click of a button?
|
|
|
|
|
Hi all,
How to call the anchor? I am using ItextSharp.dll
My textbox is: webpageurl
i want my textpage able to capture this website after i click the button <<OK>>
What can i put for >>
Using._______._____; to call the anchor ?
How to continue from here?
Anchor anchor = new Anchor("website");
anchor.setReference("http://www.lowagie.com/iText/");
anchor.setName("website");
Anchor anchor1 = new Anchor("This is an internal link");
anchor1.setName("link1");
Anchor anchor2 = new Anchor("Go to the internal link");
anchor.setReference("#link1");
ThankYou
|
|
|
|
|
Whatever ITextSharp is, I assume it comes with samples and docs. I also assume that most people here have as little idea about it as I do, as this is not a forum for users of this dll.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
can i give a standed size to all my new appiering MSN boxes???
A S E L A
|
|
|
|
|
No, you have to create your own to specify size.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
how can i maximize my form when i click on maximize button on top right sid conner??? when i click it just maximize my form bu it didn't work for items in the Form i mean like ListView Boxes, text Boxes, etc....how can i do that?
|
|
|
|
|
Anchor or dock them as appropriate.
|
|
|
|
|
ya i got it...thanks a lot....
A S E L A
|
|
|
|
|
|
ya managed to do that....thanks a lot for ur advice....
A S E L A
|
|
|
|
|
i using this codes.....some times i get this error message...any one know why????
"the process cannot access the file because it is being used by another proces"
this is the message but its not using any other process...
here is my code
foreach (ListViewItem item in listView2.SelectedItems)
{
listView2.FocusedItem = istView2.Itemitem.Index]; DSOFile.OleDocumentPropertiesClass file = new DSOFile.OleDocumentPropertiesClass();
file.Open(listView2.FocusedItem.Text, false, DSOFile.dsoFileOpenOptions.dsoOptionOpenReadOnlyIfNoWriteAccess);
file.SummaryProperties.Title = tbxTitle.Text; file.SummaryProperties.Subject = tbxSubject.Text; file.SummaryProperties.Keywords = tbxKeywords.Text;
file.SummaryProperties.Author = tbxAuthor.Text; file.SummaryProperties.Comments = tbxComments.Text; file.Close(true);
MessageBox.Show("Changes Added into Selected File"); }
A S E L A
|
|
|
|
|
The file's already open, or in use somewhere. Either by another application, or by yours in unshown code.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
you know it not come out allthe time...its come out only for first picture.
in my applicartion i got two listview boxes. i load images in to one and drag drop few in to other listview box.if i drag only one picture and when i attempt to change & save summary prop i got this msg...if i drag 1 < pictures its not come out......
A S E L A
|
|
|
|
|
... then somwhere in that logic you've still got the file open.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
There are bugs in .NET wrt opening images, your best bet is to open your image, copy it to a new image, and then dispose of the old image, to make sure the file is not locked.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
copy mean temparery copy in to another folder or copy in to application.....if it is to application i don't know how to do that....but if it is to temp folder i can manage to do that....can u please just explane that bit...
thanks a lot....Christian
A S E L A
|
|
|
|
|
Hello,
Can someone suggest how I can improve the code below to use just one kind of SQL connection to read both the Database table column names and the records in the table? I am using OleDb to read the column names from the table, then SqlCommand to read the records, but I would like to use only the one or the other. How can I read the DB records using OleDb please?
Can I use SqlCommand to read the column names from the table schema?
I am using Visual C# 2005 Express.
Thank you for taking the time to read this!
using System;
using System.IO;
using System.Text;
using System.Data;
using System.Collections;
using System.Data.OleDb;
using System.Threading;
using System.Data.SqlClient;
using System.Configuration;
namespace exportToCSVfile
{
public class Program
{
static int Main( string[] args )
{
OleDbConnection connOleDB = new OleDbConnection();
connOleDB.ConnectionString = ( the connection string );
SqlConnection conn = new SqlConnection( another connection string );
DataTable schemaTable;
string strRow;
string fileOut = ConfigurationManager.AppSettings["directoryPathKey"] + ConfigurationManager.AppSettings["fileCSVNameKey"];
string fileLogFullPath = ConfigurationManager.AppSettings["directoryPathKey"] + ConfigurationManager.AppSettings["fileLogNameKey"];
if ( !Directory.Exists( ConfigurationManager.AppSettings["directoryPathKey"] ) )
{
Console.WriteLine (
"Directory \"{0}\" does not exist", ConfigurationManager.AppSettings["directoryPathKey"]);
Console.ReadLine();
return 0;
}
try
{
connOleDB.Open();
schemaTable = connOleDB.GetOleDbSchemaTable( OleDbSchemaGuid.Columns,
new Object[] { null, null, "SomeDatabaseTable", null } );
int theArrayBounds = schemaTable.Rows.Count;
string[] columnNames = new string[theArrayBounds];
for ( int i = 0; i < schemaTable.Rows.Count; i++ )
{
object objColumnNames = ( schemaTable.Rows[i].ItemArray[3].ToString() );
columnNames[i] = objColumnNames.ToString();
}
connOleDB.Close();
string sqlQuery = "SELECT * FROM SomeDatabaseTable";
SqlCommand command = new SqlCommand( sqlQuery, conn );
conn.Open();
SqlDataReader dr = command.ExecuteReader();
DataTable dtSchema = dr.GetSchemaTable();
StreamWriter sw = new StreamWriter( fileOut, false, Encoding.Default );
string columnHeaderString = String.Join( ",", columnNames );
sw.WriteLine( columnHeaderString );
while ( dr.Read() )
{
strRow = "";
for ( int i = 0; i < dr.FieldCount; i++ )
{
strRow += Convert.ToString( dr.GetValue( i ) );
if ( i < dr.FieldCount - 1 )
{
strRow += ",";
}
}
sw.WriteLine( strRow );
}
sw.Close();
conn.Close();
}
catch ( Exception exception )
{
Console.WriteLine( exception );
Thread.Sleep( 3000 );
using ( TextWriter tw = new StreamWriter( fileLogFullPath ) )
{
tw.WriteLine( DateTime.Now + "Error: " + exception.ToString() );
}
connOleDB.Close();
conn.Close();
return 0;
}
finally
{
connOleDB.Close();
conn.Close();
}
return 1;
}
}
}
I have taken help from various sources for the code and I extend my most grateful thanks;
http://www.codeproject.com/KB/database/Cs_CSV_import_export.aspx[^]
I would include other references but I've lost those links during my extensive searching.
modified on Thursday, March 12, 2009 3:49 PM
|
|
|
|
|
I have a little problem I need some help with. IM a novice C# programmer.
Im working on a piece of software that scans a directory for mp3 files loading the filepaths into an array. It then reads some info from the ID3 tags and attempts to write this info to an Access database. All seems to work fine except after about 25 files I get a System.OutOfMemory Exception. Im thinking either the ID3Info objects or the OleDbCommand objects arent disposing correctly so I threw in the System.GC.Collect and it did succeed in getting me farther but Im still getting the error. Anyone see anything Im missing?
int i = 0,duration, year;
string artist, title, album, bandname, genre, path;
string delSql = "DELETE * FROM Library";
musLibConn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\GeneSys\Library.mdb";
OleDbCommand deleteLib = new OleDbCommand(delSql, musLibConn);
musLibConn.Open();
if (tbMusPath.Text != "")
{
utility util = new utility();
filepaths = Directory.GetFiles(util.getLibPath(), "*.mp3", SearchOption.AllDirectories);
deleteLib.ExecuteNonQuery();
ID3Info CurrSong;
OleDbCommand insertLib;
pBar.Visible = true;
foreach(string str in filepaths)
{
CurrSong = new ID3Info(filepaths[i], true);
path = filepaths[i].ToString();
artist = CurrSong.ID3v2Info.GetTextFrame("TPE1").ToString();
title = CurrSong.ID3v2Info.GetTextFrame("TIT2").ToString();
album = CurrSong.ID3v2Info.GetTextFrame("TALB").ToString();
lblPath.Text = path;
string insSql = "INSERT INTO Library(Artist,Title,Album,Path)"+
"VALUES('"+artist.Replace("'","''")+"','" + title.Replace("'","''") + "','"+
album.Replace("'","''")+ "','" +path.Replace("'","''") + "')";
insertLib = new OleDbCommand(insSql, musLibConn);
insertLib.ExecuteNonQuery();
i++;
System.GC.Collect();
}
pBar.Visible = false;
lblNum.Text = Convert.ToString(filepaths.Length);
util.setNoFiles(filepaths.Length);
Thanks for the help
Jon
|
|
|
|