15,911,306 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Mayank Cool (Top 8 by date)
Mayank Cool
31-Mar-14 4:39am
View
When we use ComboBox1.SelectedText it gives an error-Cannot bind to the property or column EmpId on the DataSource.
Parameter name: dataMember
Mayank Cool
27-Mar-14 4:28am
View
Thanks...it will works @VishalKadiwala
Mayank Cool
1-Mar-14 8:36am
View
because i want to move from third form to Emppanel.cs.
Mayank Cool
1-Mar-14 8:29am
View
Setting the id is of no use because on calling of constructor it again initialize all the components..
Mayank Cool
1-Mar-14 8:19am
View
How tell where to set the id..
Mayank Cool
1-Mar-14 8:18am
View
here is my code-
public partial class EmpPanel : Form
{
string id1;
string x = "";
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["AttendanceManagmentSystem.Properties.Settings.Cons1"].ConnectionString);
public EmpPanel(string uid)
{
InitializeComponent();
this.id1 = uid;
}
public EmpPanel()
{
InitializeComponent();
this.button1.Enabled = false;
this.ControlBox = false;
}
private void EmpPanel_Load(object sender, EventArgs e)
{
showtime();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["AttendanceManagmentSystem.Properties.Settings.Cons1"].ConnectionString);
SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["AttendanceManagmentSystem.Properties.Settings.Cons1"].ConnectionString);
SqlCommand com1 = new SqlCommand("select Date from LoginDetail1 where EmpId='" + id1 + "'", con1);
con1.Open();
DataTable dt = new DataTable();
SqlDataAdapter adapter = new SqlDataAdapter(com1);
adapter.Fill(dt);
foreach (DataRow row in dt.Rows)
{
string Date1 = row["Date"].ToString();
string[] Date2=Date1.Split(' ');
string date3 = Date2[0];
if (label5.Text != date3)
{
x = "Yes";
button3.Enabled = false;
button2.Enabled = false;
}
else
{
x = "No";
label6.Visible = true;
this.ControlBox = true;
button1.Enabled = false;
button2.Enabled = false;
button3.Enabled = false;
}
}
con1.Close();
}
Mayank Cool
1-Mar-14 8:07am
View
I am setting the Id right.But when again the constructor is called it initialize to 0.
and if i am passing the id from button4_click then it agains creates a problem because on the formload i am checking if the date is equal to current date then it cant's login it..
Mayank Cool
1-Mar-14 7:57am
View
I Cann't understand what you want to say..
Show More