|
Wierd - it works for me. Search your project for ShowInTaskbar = false - it's possible that the setting in the designer file is being overridden elsewhere.
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) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
There IS An Erorr
ManagementScope theScope = new ManagementScope("\\\\computerName\\root\\cimv2");
StringBuilder theQueryBuilder = new StringBuilder();
theQueryBuilder.Append("SELECT MACAddress FROM Win32_NetworkAdapter");
ObjectQuery theQuery = new ObjectQuery(theQueryBuilder.ToString());
ManagementObjectSearcher theSearcher = new ManagementObjectSearcher(theScope, theQuery);
ManagementObjectCollection theCollectionOfResults = theSearcher.Get();
foreach (ManagementObject theCurrentObject in theCollectionOfResults)
{
string macAdd = "MAC Address: " + theCurrentObject["MACAddress"].ToString();<-----------Erorr(Object Reference not set to an ...)
MessageBox.Show(macAdd);
}
What can I Do?
|
|
|
|
|
Hello.
Please keep the question to the original post, if you need to clarify something, respond to the person that posted it. You've posted this in the right place, and then posted it again. This is doubly bad.
Please also use descriptive subject lines, ""I Am Sorry To Ask Again" is not good subject lines. The reader should get an indication on your post by reading your subject line. It will help the right person answer your questions.
Now i'll answer this in the right place.
|
|
|
|
|
|
Sir,
I am once again typing the question by the help of example. I get data in datagridview only filter information. on filter information of datagridview, first colom is Emp id when i click on emp id the complete information show of the employee on next page datagridview.I hope its clear now
thanks
|
|
|
|
|
HI Experts,
I have used Picturebox to display my image....after my mouse over the image i want the information of that picture to b displayed.......
Thanks in adv.
|
|
|
|
|
Take a look at How To Add ToolTips To Controls On A Windows Form[^]. If that does not help you, please come back with specific questions.
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.”
|
|
|
|
|
Thanks It Helped Me
|
|
|
|
|
Hi All,
I am new to c#. I am creating a WPF application in C# in which I am to pass image path. Please tell me how to add resource to my project.
|
|
|
|
|
MPTP wrote: Please tell me how to add resource to my project.
This [^]should help you.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
In solution explorer right click on project name and select its properties menu item. It will open the Project Properties page, on that page there will be resource tab available in left side click that tab and it will bring you the page to add resource to your project.
|
|
|
|
|
I use a NotifyIcon in the SystemArea.
notifyIcon1.Icon = Properties.Resources.Lamp_Black_Icon;
works.
I also use images resembling LED's on my form
picBox[i].Image = Properties.Resources.Lamp_Unavailable;
doesn't show an image.
For the NotifyIcon the image file is .ico. For the picBox, the file type is .png.
Both have Cust Tool Namespace set to the correct namespace. (Wouldn't compile if otherwise.)
Both are set to Build Acvtion Embedded Resource.
If I look in Project Properties Resources Images I can see the images.
The images used to display when I hade them loaded into an ImageList. (But that way I don't get them embedded in the exe file.)
What's wrong?
|
|
|
|
|
1. Add the image files to your project so that they show in the Solution Explorer.
2. Highlight each image file in turn, and in the Properties window, choose "Embedded Resource" for the "Build Action"
That ought to fix it.
|
|
|
|
|
Unfortuately, that is exactly what I did!!
Tried setting them all to Visible (just in case) as well.
Experimented and found that usinf a jpg file instead of png file works.
Looks like a bug. And I need png format because of tranparency.
|
|
|
|
|
Sorry, I didn't notice that you had done that already.
I'm glad you resolved it.
|
|
|
|
|
Not resolved!! Jpg no good because it doen't have transparency.
Will ask question if there is a specific problem with png and Resources
|
|
|
|
|
I wanna know how can I connect my form on visual studio to the database.
I have a form with the following labels & text boxes for them: user name, password, gender, employee code, date of birth, department. There's also a submit button in it.
I hav created a table having the same above mentioned columns. I want that after filling the entries in the form when the submit button is clicked, the data should automatically be stored in the database. Pls help me & tell me the method to this.
|
|
|
|
|
If you are using SQL as a database, look into System.Data.SqlClient namespace. Or else, take a look into System.Data.OleDb namespace.
Check this[^] article.
modified on Monday, July 13, 2009 5:27 AM
|
|
|
|
|
Add namespace Using System.Data.SqlClient
Make SQLConnection object and pass the connection string to it.
eg :- SqlConnection con = new SqlConnection("paste Connection string here");
SqlCommand cmd;
cmd = new SqlCommand("Write Inserrt Query Here",con);
con.open();
cmd.ExecuteNonQuery();
con.close();
MessageBox.Show("Inserted");
|
|
|
|
|
Hi.. Heres the code for it...
Do appologize me if any error occurs merely due to my coding...
using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
SqlConnection con;
SqlCommand cmd;
string username,password,gender,empcode,dateofbirth,department;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
con = new SqlConnection();
con.ConnectionString = "Data source=.;Initial Catalog=Master;user id=sa;password=123";
con.Open();
MessageBox.Show("Connection Opened");
}
private void button1_Click(object sender, EventArgs e)
{
username = textBox1.Text;
password = textBox2.Text;
gender = textBox3.Text;
empcode = textBox4.Text;
dateofbirth = textBox5.Text;
department = textBox6.Text;
cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText="insert into employee values('"+username+"','"+password+"','"+gender+"','"+empcode+"','"+dateofbirth+"','"+department+"')";
cmd.Connection = con;
cmd.ExecuteNonQuery();
MessageBox.Show("Recods Inserted Successfully");
}
}
}
Hope this helps u out... If any error occurs do let us know about it...
Cheers,
Thashif
|
|
|
|
|
thnx for helping.....bt can u pls tell us the code if it is to be used for oledb instead of sql.....
|
|
|
|
|
I think in this case u can refer to the post mentioned by d@nish...
change the namespace and the query accordingly... Feel free 2 clarify ur doubts... Mentioning ur error msg will be more helpful...
Cheers,
Thashif
|
|
|
|
|
its just the same as sql... in place of sql type oleDb... Dont 4get to change the namespace too... in the connectionstring change it as "provider=MSDAORA;datasourse=xe;user id=ur userid;password=ur password";
Hope this helps out...
post the error msg if u have any...
Cheers,
Thashif
|
|
|
|
|
thanx a lot....the prblm has been solved.......
|
|
|
|
|
How do I instantiate an EntityObject with a Referencekeys for browsable objects.
I'd like to do an XML to LINQ then convert it back as an entity object. now my problem is when I do this.
GIVEN:
XML from store procedure
<Peoples>
<People>
<Name>name1</Name>
<Work><Work>
<Nickname>name1nick</Nickname>
</People>
</Peoples>
People --> EntityObject
People.Work --> Browsable Object (one to many relation)
People.NickName --> Extended property, not a EdmScalarPropertyAttribute (just a simple custom scalar string property)
var list = from peoples in XMLResult.Descendants("Peoples")
select new People
{
Name = peoples.Element("Name").Value,
Work = ??? (How do I load the this?), should I do (Work = _ObjectContext.Work.WorkID.Equals(peoples.Element("Work").Value), "Query in the object context?"
Nickname = peopls.Element("Nickname").Value
};
Now you might be thinking why not just do this...
var list = from people [ObjectContext].People
select people;
The reason is because People.NickName property is not a Table column, the data is generated from the stored procedure (which I had other processes) and is return as XML;
If i skip People.Work it would give an error. hope its clear.
|
|
|
|