|
If the code from d@nish does not work, please come back, and I will try to help you.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thank you also Henry
Gerry.
|
|
|
|
|
Are you saying that you want MAIN to launch a new form, DIALOG_B, and make it an MdiChild of MAIN, then DIALOG_B creates a new instance of DIALOG_A and make it an MdiChild of DIALOG_B???
You can't do that. An MdiChild form cannot also be an MdiParent at the same time.
|
|
|
|
|
|
hello
can Console app be minimized to system tray?
Thanks
dev
|
|
|
|
|
You will have to write a separate app that would show an icon in the tray. But then, I am not sure if you could hide a console window. What's wrong with a normal application? Why a console app?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
See this[^] link.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Interesting! So, console is also being emulated by the framework, I guess. Otherwise, a 'console' as such may not be able to understand a ShowWindow() call. I wonder how simple has .NET made things for programmers.
But it's such a relief that at least the tray app has to be written separately (as opposed to the framework exposing something like ThisConsoleApp.HaveTrayIconz = true; ).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hello Everyone
This is Shakeer Baig from India. I am a Programmer in C#.Net. I would like to develop a application which consists more of Notepad more of Wordpad more of Mspaint more of Alarm CLock more of Games more of PDF files more of Scientific Calculator all into one single application which is more helpful for the future Mankind and i do not know a source code for how to retrieve a image from a Sql Database Even if i get the Image not the desired. So pls kindly share your views with me.
Thanks and Regards
Shakeer Baig.
|
|
|
|
|
I suggest you start with some less ambitious goals; study a couple of books, read some articles here on CodeProject, and then try some small apps first.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
sshakeerbaig wrote: I would like to develop a application which consists more of Notepad more of Wordpad more of Mspaint more of Alarm CLock more of Games more of PDF files more of Scientific Calculator all into one single application which is more helpful for the future Mankind and i do not know a source code for how to retrieve a image from a Sql Database Even if i get the Image not the desired. So pls kindly share your views with me.
Bad question.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
sshakeerbaig wrote: helpful for the future Mankind
Don't breed.
|
|
|
|
|
A few more features and it could well become an OS. But wait...an OS written in .Net!!!
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Hello!
Some of the images I try to embedd do not show up in my email, but are instead sent as attachments. I can´t figure out why some are working and some arent. This is how I embedd images:
MailMessage mail = new MailMessage();<br />
<br />
string imagePath = System.Windows.Forms.Application.StartupPath + "\\pathToImages";<br />
<br />
LinkedResource resource1 = new LinkedResource(imagePath + "\\head21.jpg", <br />
System.Net.Mime.MediaTypeNames.Image.Jpeg);<br />
resource1.ContentId = "head21.jpg";<br />
<br />
LinkedResource resource2 = new LinkedResource(imagePath + "\\border.jpg", <br />
System.Net.Mime.MediaTypeNames.Image.Jpeg);<br />
resource2.ContentId = "border.jpg";<br />
<br />
StringBuilder content = new StringBuilder();<br />
<br />
....<br />
<br />
content.Append(string.Format("<td width=600 align=left><img border=0 align=center src=\"cid:head21.jpg\" width=600 height=57></td></tr></tbody></table></td></tr></tbody></table>"));<br />
<br />
..<br />
<br />
content.Append(string.Format("<td><img alt=\"\" src=\"cid:border.jpg\" width=560 height=21></td></tr></tbody></table></td>"));<br />
<br />
..<br />
<br />
string body = Mail.CreateHtmlFromTemplate(content.ToString(), string.Empty, null);<br />
<br />
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(body, null, MediaTypeNames.Text.Html);<br />
<br />
htmlView.LinkedResources.Add(resource1);<br />
htmlView.LinkedResources.Add(resource2);
Here resource1 works fine, and shows up in body of email. Resource2 is instead sent as attachment and does not show up in the email. Does anyone have any idea why this is?
|
|
|
|
|
Neat, you can do that?
My guess is that it may have something to do with the html?
How about if you don't do any of the table stuff, and just put the images inline? Does that work??
I've always found coding tables in HTML as tricky. It's easy to miss something. And, depending on the browser, the browser may or may not "fix" some html coding errors.
__________
Joe
|
|
|
|
|
Thanks for your response!
I tried just having the faulty image in a div instead, but it didn´t work
EDIT: My mistake u were absolutely right. There wasnt enough room for the image, thats why it was sent as an attachment. Thanks alot!
modified on Tuesday, August 18, 2009 4:37 AM
|
|
|
|
|
Cool! I'm glad that you found the problem!
I've always found tables to be a pain in HTML.
___________
Joe
|
|
|
|
|
try
{
this.bioSecureDataSet.Login.Rows.Remove(loginrow);
this.loginTableAdapter.Update(this.bioSecureDataSet.Login);
this.bioSecureDataSet.Employee.Rows.Remove(employeerow);
this.employeeTableAdapter.Update(this.bioSecureDataSet.Employee);
}
catch (OleDbException)
{
MessageBox.Show("Database Error");
return;
}
I have a form which enables me to scroll and view through each individual staff's particulars. then i would have a remove button if i want to remove that staff and his/her particulars data row from the database table. but i keep getting this error "The given DataRow is not in the current DataRowCollection". Help?
|
|
|
|
|
I'm not 100% up on data sets, but I think the following are likely to cause your problem:
1. loginrow or employeerow have already been deleted from the datarow collection.
2. The table adapter is empty.
3. (Especially likely in a postback on a ASP.net site) The instance of the row you are providing is not the same as the one in the Table adapter.
Can you provide more debug / implementation info (e.g. what type of form is it)?
|
|
|
|
|
BioSecureDataSet.EmployeeRow employeerow = ??;
BioSecureDataSet.LoginRow loginrow = ??;
this.bioSecureDataSet.Login.Rows.Remove(loginrow);
this.loginTableAdapter.Update(this.bioSecureDataSet.Login);
this.bioSecureDataSet.Employee.Rows.Remove(employeerow);
this.employeeTableAdapter.Update(this.bioSecureDataSet.Employee);
I'm sure i have to define the loginrow and employeerow.
but i don't know what to define them as? I just want it to be the current information(data row) that it is showing..
|
|
|
|
|
Let's pretend Login has a string property "Id" as the primary key. Your code will might look like
BioSecureDataSet.EmployeeRow FindEmployeeRow(string id)
{
return this.bioSecureDataSet.Login.Rows.Find(id);
}
void YourMethod(string loginId, )
{
BioSecureDataSet.EmployeeRow employeerow = FindEmployeeRow(loginId);
}
Note that the exact implementation depends upon the primary key on your data set!
|
|
|
|
|
Remove method of DataRowCollection removes the data from DataTable not from the database.
To remove to row both from DataSet and your DB using DBDataAdapters you should call DataRow.Delete() into your case:
<br />
loginrow.Delete();<br />
this.loginTableAdapter.Update(this.bioSecureDataSet.Login);<br />
Life is a stage and we are all actors!
|
|
|
|
|
hmmm. i got the error "Object reference not set to an instance of an object."
|
|
|
|
|
And where exactly it occurred?
Life is a stage and we are all actors!
|
|
|
|
|
loginrow.Delete();
It say Null Reference Exception was Unhandled.
|
|
|
|