|
hello
How can you compile say for example SomeProgram.exe, which references A.dll/B.dll/C.dll, into one single executable/exe which includes the dll as embedded resources as well (i.e. no separate dll, just single exe)
Thanks
dev
|
|
|
|
|
I think ILMerge will help you, but it works for .NET dll´s only.
|
|
|
|
|
|
In addition to Thomas Krojer's answer, if your DLLs are unmanaged than check out this[^] article.
In case of managed DLLs here[^] you can find a good resource for using ILMerge.
|
|
|
|
|
|
|
|
You are welcome!
|
|
|
|
|
i have bitmap that changes on run time.
each time the bitmap change i need to update the pictureBox that i have on my form.
I cant find a way to change the image on the pictureBox -
Each time i do
pictureBox.Image = myBitmap;
I get error.
What to do ?
|
|
|
|
|
Whats your myBitmap contains.
Use
pictureBox.Image = New System.Drawing.Bitmap("YourBitmapFilename.BMP");
|
|
|
|
|
What error do you get?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Yanshof wrote: I get error.
What to do ?
We aren't mind readers, if you don't tell us what the error message is, the only available advice is: read the error message, look at the file name and line number it mentions, and fix it.
|
|
|
|
|
I change something in the code and i think that the error message was from some other place.
But the Image is not shown on the pictureBox yet - and i dont know what is the reason.
The input of the pictureBox is bitmap that i collect and store on some collection - so there is no actually file that the bitmap is save on.
|
|
|
|
|
when an error occurs, a lot of detailed information is available. At compile-time, an error always has a filename and line number associated with it, and one should look at that particular line. At run-time, managed code throws exceptions and when looking at them, they too reveal a class name, method name and line number, typically sufficient to pinpoint the problem.
finally when code runs without exceptions but does not produce the result one hopes for, there is that thing called debugging. Try single-stepping, try looking at some intermediate values, etc. And when all else fails, you can ask on a forum like this one, however then you need to provide an accurate symptom description and the relevant piece of code so some one can effectively help you.
|
|
|
|
|
Hi, as i titled i really need to compile a vdproj in command line or in c# classes! i googled and i found nothing really related!
THANK YOU
|
|
|
|
|
Take a look at MsBuild.
Best wishes,
Navaneeth
|
|
|
|
|
MS build cant build vdproj, test it!!!!!!
devenv could do this!
|
|
|
|
|
hi
where i should use SqlCommand.Parameters.Add()method and where
SqlCommand.Parameter.AddWithValue()?
is there performance diffrence?
|
|
|
|
|
Hi,
Specially parameters used to pass data to ur query , as inset update delete even select
select *
from t1
where id = 12
this query always returns a fixed result, now going to make it gloabal, i mean change the 12 value to needed value, so u use parameters as:
select *
from t1
where id=@id
now in command line, u must set the parameter, look at this method as a sample:
private DataTable SelectParameter(int idvalue, bool useWithvalue)
{
string constr = "";
SqlConnection con = new SqlConnection(constr);
SqlCommand cmd = new SqlCommand("select * from t1 where id=@id", con);
if (useWithvalue)
{
cmd.Parameters.AddWithValue("@id", idvalue);
}
else
{
SqlParameter p = new SqlParameter("@id", SqlDbType.Int);
p.Value = idvalue;
cmd.Parameters.Add(p);
}
con.Open();
DataTable dt = new DataTable();
dt.Load(cmd.ExecuteReader());
return dt;
}
in cases that u are going to set the value type of parameter u should use add else u could use both of them.
|
|
|
|
|
I hear that AddWithValue is kinda safer, but I rarely use it because of the way I do things.
It's not a performance issue.
|
|
|
|
|
I like .AddWithValue just to save keystrokes, but never noticed any performance difference either way.
|
|
|
|
|
I'm trying to retrieve an application from my database. I have a Data Context in my app called AppSecurityDataDataContext. Here's my query:
{
AppSecurityDataDataContext dc = new AppSecurityDataDataContext();
var app = from a in dc._Applications
where a.ApplicationId = ApplicationID
select a;
}
I'm getting "Could not find an implementation of the query pattern for source type 'System.Data.Linq.Table<AppSecurity._Application>'. 'Select' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?"
I have the using statement in my class. This other method works:
public static void AddApplication(Application Application)
{
_Application app = new _Application
{
ApplicationName = Application.ApplicationName
};
_DataContext._Applications.InsertOnSubmit(app);
try
{
_DataContext.SubmitChanges();
}
catch (Exception e)
{
}
}
Anyone see what's wrong here?
Everything makes sense in someone's mind
|
|
|
|
|
Do you have the LINQ dll referenced in your project as well as the proper build target set?
|
|
|
|
|
As I said in my post, I have the using statement in my class.
Everything makes sense in someone's mind
|
|
|
|
|
Because a using statement and required dll's or correct version of dll's are synonymous.
|
|
|
|