|
Can catch the Error in Try Catch Block so can find the exact error message.
Please verify once again your image file might be file is not correct format.
explaon me also what you have done before loading the file
Parwej Ahamad
If you are hang on then you can send me mail g.parwez@gmail.com
|
|
|
|
|
thanks for replying
it loads while viewing from external program.I am downloading this file from Ftpserver,saving it on my System's drive and then accessing it.
I have given enough time for file to download. Unless the whole file is downloaded i dont proceed for Loading the image.
|
|
|
|
|
Can post here code ?
I think you have defined buffere size little bit maximum.
Parwej Ahamad
If you are hang on then you can send me mail g.parwez@gmail.com
|
|
|
|
|
no the buffer size is perfect for downloading
|
|
|
|
|
Dont dispose of the image (img1). This is a known issue.
|
|
|
|
|
Disposing or not disposing of the image object (img1) doesnt help.
While using
Bitmap img1 = new Bitmap(path, false);
its throwing Invalid Parameter Used Exception.
|
|
|
|
|
Image img =image.FromFile(path);
img.GetThumbnailImage(150, 150, new Image.GetThumbnailImageAbort(Nothing), IntPtr.Zero);
Nothing will be a function which will return a bool like .
private bool Nothing()
{
return true;
}
|
|
|
|
|
m am working with C#.net 1.1 desktop application.
As soon as Image img1 = Image.FromFile(iSelected); executes it throws an memoryexception
|
|
|
|
|
i m having three versions of my application...now the client want to use my second version(was using the first version)...so he wants that his database should not be lost....so i want to insert all the records from the old database to the new database(which is having some different field)...so i asked the user to enter the path of the database then check the tables name...but i didn't get how to find the fields name of tables....and then how will i insert the records from that database tables to new database tables....please someone help...both databases are in ms-access
|
|
|
|
|
We used "CREATE TABLE" and "ALTER TABLE" for modifying an old database to a new version. We checked the existence of an field in a table, e.g. "SELECT [somefield] FROM [sometable] WHERE 1 = 1", if the field does not exists, you know you has opend an old db, then create tables, alter tables, add some data and so on ...
|
|
|
|
|
Hi can anyone write a one line if() condition to find out whether a string array has undefined values??
I am checking like this:
if(arr == nullptr)
but this does not help..
Som
|
|
|
|
|
if(arr == null)
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
This checks if array itself is null. I think the OP want to know if array contains at least one item that is null.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
What about if(Array.IndexOf(arr,null)>-1) ?
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
His teacher will be impressed!
All the best,
Martin
|
|
|
|
|
foreach(string s in arr)
{
if(s==null)
{
return true;
}
}
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
assign null on the definition of your array and then you can check if(arr==null) otherwise compilor will gave error
|
|
|
|
|
Hi,
From C# I'm using an OdbcCommandBuilder to generate DELETE, INSERT and UPDATE commands for updating a MySQL table and I receive the following error:
"Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information."
I thought this was because the table had no primary key. But I checked and it does. Does anyone know another reason why I get this error?
Thanks
|
|
|
|
|
I think that this error is because you are passing a delete command for select statement. Can you please post your code for me to look into?
|
|
|
|
|
Nope, I'm pretty sure it's not that. But here's the code anyway.
OdbcDataAdapter adapter = new OdbcDataAdapter();
OdbcCommand comm = new OdbcCommand("SELECT * FROM `" + tableName + "`", connection);
adapter.SelectCommand = comm;
OdbcCommandBuilder builder = new OdbcCommandBuilder(adapter);
adapter.DeleteCommand = builder.GetDeleteCommand();
adapter.InsertCommand = builder.GetInsertCommand();
adapter.UpdateCommand = builder.GetUpdateCommand();
I suppose the insert and update commands don't work either but I get the exception when trying to generate the delete command.
|
|
|
|
|
adapter.DeleteCommand = builder.GetDeleteCommand();
adapter.InsertCommand = builder.GetInsertCommand();
adapter.UpdateCommand = builder.GetUpdateCommand();
In the above lines of code you are trying to get the delete and update commands, but you have not assigned them any where. You have only assigned select command by using
adapter.SelectCommand = comm;
I hope it helps sort out your problem
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
The Get{Delete,Insert,Update}Command() methods analyze the select command of the data adapter, and generate OdbcCommand objects according to the data returned by the select command. I've checked their CommandText properties during Debug and they seem ok. If I didn't assign them, the error would be something like "use of unassigned command" or another message, but not the message that I get. If you meant something else by assigning the commands, please give me an example.
The problem is not with the code but with the database. I know this because it works on one database but it fails on another database with exactly the same structure but from another computer. Could it be the MySql version?
Adrian
Junior Developer
|
|
|
|
|
do a thing comment out the update and delete options and test if select is working alone?
If so then the second thing you could check is that you are passing primary key for update and delete commands.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
I tried not calling GetDeleteCommand(), GetInsertCommand() and GetUpdateCommand() some time ago and it didn't work.
How do I check if I'm passing primary key? Should I adapter.Fill() a table and check if there is a primary key? I can do that.
I can generate the commands manually too (but I'd like to avoid that).
I'm just trying to understand why the same code works just fine on one computer, but it doesn't on another computer with the same operating system and the same database structure.
Would you happen to know if on older versions of MySql, the "select * from <table_name>" command doesn't return key column information even if there are keys in the table?
|
|
|
|
|
Hi,
i have a problem with the Currencymanager.
When i assign the Currencymanager.CurrentChanged event (even when the function has no code) i cannot use Currencymanager.addnew . The position in the datagrid remains on another record for editing.
When not assigning the Currencymanager.CurrentChanged event then i can use Currencymanager.addnew and the position in the datagrid is on the new record for inserting.
Anyone any idea why this happens and how i can remain on the correct position for editing even when Currencymanager.CurrentChanged is assigned?
i need this event to know when the position of the cursor has been changed.
thx
Kurt
|
|
|
|