|
|
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.
|
|
|
|
|
Hi..
I need ur Help.
just give me simple logic
i Make a progrm users IN And OUT.I make a table in my database like USERNAME, DATE,INTIME, OUTTIME, when User come Select IN and click save button save in my database USERNAME, DATE,INTIME, after he going he select OUT save in my database in Same line just out timing of user.
Thanks In Advance
Jawad khatri
|
|
|
|
|
Find last IN status for user and update that row by upadating OUTTIME value.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Superficially the program logic looks easy, but there are some edge cases that you want to consider. What happens if your user chooses to select in twice without selecting out? When you code your application, you need to think about the different ways that the user interacts with it, and work out where they could go wrong. I normally find that sketching out a simple UI on a piece of paper helps to concentrate my mind on what can (and will) cause problems with my interface.
There are two approaches to solving the problem I just gave you. The first approach is to have the application prevent you from performing the IN operation if there's one that doesn't have an OUT operation. The second approach is to allow the application to perform the IN operation, but to warn them that they have a problem because they didn't log out before, and they need to seek help. The method you choose depends entirely on your business processes, so you need to take them into account.
"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 | Onyx
|
|
|
|