TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mahmud_uk
NA
48
0
Refrencing Event
Aug 19 2004 5:46 AM
Hi Guys I have two Forms. In form1 there are two textBoxes, i'm trying to refrence these two textBoxes in Form2. I'm having problem refrencing them. I need to call these two textBoxes inorder to authenticate users. Both these textBoxes have been made public. Also i have tabPages in form2,from tabPage2, by a click of a button i'm trying to pen tabPage3, but having problem with this too. This is mainly due to authentication problem. Heres the code: private void button1_Click(object sender, System.EventArgs e) { SqlConnection da = new SqlConnection( @"Data Source= xxxxxx;"+ "Initial Catalog = xxxx;" + "Network Library=DBMSSOCN;"+ "user id =xx;"+ "Password=xxxx"); da.Open(); SqlCommand thisCommand = da.CreateCommand(); tabPage3.Show(); String sQuery = "SELECT Name, LicenseID FROM License WHERE Name = '"+ Form1.textBox1.Text +"' AND LicenseID = '"+ Form1.textBox2.Text +"'"; SqlCommand cmd = new SqlCommand(sQuery, da); SqlDataReader dr = cmd.ExecuteReader(); if(dr.Read()){ tabPage3.Show(); label3.Text = dr[ "Name" ].ToString();} da.Close(); } What do i need to do inorder to solve this scenario. Thanks,
Reply
Answers (
1
)
C# How can I delete things which I drew with GDI+
Cannot push a null value to a database using an inherited DateTimePicker