|
Hello friends need help here..
Before this I have learn to create password validating form.Which is user have to key in password to enter another form. The password is default that have set in the coding.Now I need help how to connect to MY Sql database from C# from and compare the password that already I set in MY Sql database,table name Security and Field name password and the password is "ABCD".I dont know how to use SQL server 2005.
Below are the coding for the first form that validate to enter to form2.
//////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace cubaan1
{
public partial class Form1 : Form
{
Form2 form1 = new Form2();
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
textBox1.PasswordChar = '*'; //Masking Char
textBox1.MaxLength = 14;//Max Length is 14
}
private void button1_Click(object sender, EventArgs e)
{
string strDefaultPassword = "security"; //Keep the default password
string strEnteredPassword = textBox1.Text;
if (strEnteredPassword == strDefaultPassword)
{
this.Hide();
form1.ShowDialog();
}
else
{
MessageBox.Show("Wrong password entered");
this.Close();
}
}
}
}
//////////////////////////////////////////////////////////
How to change this to connect to MY Sql Database and compare the password from the database.
Tq in advance......
|
|
|
|
|
CLASSES:student PROPERTIES :string name,string grade,string studentid,string surname METHODS:Add(string lessonCode, int point),grade showGrades(string lessonCode)
CLASS:grade PROPERTIES:String lessonCode,int point METHODS:
CLASS:reg PROPERTIES:int NumberOfRegs METHODS:AddStudent(student stu),RemoveStudent(string studentid),student ShowStudent(string studentid)
these are the classes,properties and methods that i have to use...
*students names,surnames,studentid and grades will be stored
*if any of the fields name,surname or grades if blank the registration wont be done
*for every student grades can be added
*studentid cant be changed,we can see the number of students,and we can call the students by their studentid
THATs all i need..i tried so hard but coludnt find a solution..
THX for your helps
|
|
|
|
|
Please don't start multiple threads on the same subject.
There is a modify link on your original post if you need to change your post.
Personally, I don't see that this post is any better than the last.
Please read my relpy to your original message.
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Make a start on your homework, when you get stuck we'll help you. But we won't do your homework for you. It would be unfair on you, even although by helping you with your homework you get the answer without learning anything it makes my job more secure.
So, some hints to get you started.
You have been given a list of classes, their properties and methods. Those are stubs that you can start writing. Then you just have to fill in the blanks.
|
|
|
|
|
yvzhn! this is Professor Ulhas from ur university.
when I saw u posted ur homeworx on the cpian web sights, i knew who u were. I told teh students never ever to post homoworks on the csexian webpags. now i see your failings i must felunks you in the highest orders. i have a doubt about your future life as soon i must curse you wit shiva devils for ur cheatings. infiinite melancholy! here is ur cursings!
vil humo ∑ﮗ shivna bar shiva ₣♂ un ulum ☺Ҝ♠ж dar niftu! ∑ ۞
sad curses
Sincelery yours, Computer Information conSciences Professor and grader, Sharada Ulhas
|
|
|
|
|
CLASSES PROPERTIES METHODS
student string Name grade Add(string lessonCode, int point)
grade ShowNotes(string lessonCode)
string studentid
grade [] grades
string Surname
grade String lessonCode
int Point
reg int NumberOfRegs AddStudent(student stu)
RemoveStudent(string studentid)
student ShowStudent(string studentid)
these are the classes,properties and methods that i have to use...
*students names,surnames,studentid and grades will be stored
*if any of the fields name,surname or grades if blank the registration wont be done
*for every student grades can be added
*studentid cant be changed,we can see the number of students,and we can call the students by their studentid
THATs all i need..i tried so hard but coludnt find a solution..
THX for your helps
|
|
|
|
|
|
If you really tried so hard, then you should be able to present at least the tiniest little bit of input from yourself, and not just pasting in the homework assignment.
There are a lot of people here that can give you useful hints, but for that you have to present what you have done, and where you are stuck.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hello! I've made a animation of ball, flying on the form, from the edge to edge. But i've put a PictureBox,and the ball isn't seen anymore. It is flying in the backwards of my picttureBox. I've tryed to BringToTheBack the pictureBox, but it is not working. What should i do?
One nation - underground
|
|
|
|
|
AFAIK you can do nothing, since the PictureBox is a Control of the Form and you cannot overwrite its area when drawing inside OnPaint. As workarounds you can:
(1) use a another PictureBox to represent the bouncing ball.
or
(2) Build a customized PictureBox (deriving from the original one), and override the paint method to make it aware of the overlapping ball.
hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hello Dear Friends !!!
I have a window with a button, which calls other window. There i call function
public void ShowOneInListView(ListView L, string N, string M, string S)<br />
{<br />
ListViewItem item = new ListViewItem(N);<br />
item.SubItems.Add(M);<br />
item.SubItems.Add(S);<br />
item.ForeColor = Color.Violet;<br />
L.Items.Add(item);<br />
}
which uses the listview(L) from another form. How can i access that listview, or that form ?
-- modified at 5:58 Sunday 1st April, 2007
One nation - underground
|
|
|
|
|
|
Thanks !!!!!!!!!!!!!!!!!
One nation - underground
|
|
|
|
|
Sir, can I have a doubt that If C# does not support Pointers then how C# is able to Support Runtime Polymorphism ? Pls help me in understandig the concepts better.
Thanking You
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
|
You should've been here yesterday
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I created a small Windows form using C# that add and remove text from a file. To run the Windows form a user just need to click on the "Enablelog.exe." The "Enablelog.exe" only has a name attached to it(Enablelog.exe) which make it looks very plain. Can some one show me how I can add an image to it so that it will be on the "Enablelog.exe" and make it looks more professional. I am using Visual Studio 2005.
Any help will greatly be appreciated,
Donjuanwu
|
|
|
|
|
Try using an Icon
If you created the project with Visual Studio then you should have a "app.ico" or something like this into the project files
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
In your project's property => Application pane => you'll find a ComboBox to choose an icon for your application.
Regards
|
|
|
|
|
Vlad Stanciu and Nader Elshehabi thank you very much.
|
|
|
|
|
Hi
I'm trying to send mail through the MailMessage object.
I know that the body property of the message receives a string.
I wanted to know if there is a way to set the body of my mail to load an HTML file (or any other file, for that matter) so that the mail will not consistof a text only.
thanks
|
|
|
|
|
System.Web.Mail.MailMessage msg;
System.Web.Mail.SmtpMail.SmtpServer = "your.smtp.server.com";
msg = new System.Web.Mail.MailMessage();
msg.BodyEncoding = System.Text.Encoding.ASCII;
msg.From = txtFrom.Text;
msg.To = txtTo.Text;
msg.Cc = txtCc.Text;
msg.Bcc = txtBcc.Text;
msg.Subject = txtSubject.Text;
msg.Body = txtBody.Text;
System.Web.Mail.SmtpMail.Send(msg);
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi everybody,
Is there an attribute or some other way to validate that a property has a unique value.
To illustrate what i mean, watch the "Name" property in the property grid of each control added to a windows form. It is unique!
How can i achieve this capability too?
Thanks in advanced,
elaj
|
|
|
|
|
Hi all,
i am going to write window form application in C# that has TextBox and other control on it. i want to support two languages input for same one textbox depending on user selection via some radio buttons. i have searched on internet but all the posts say language can be changed for current thread. this means it will change language for all the controls on the from. please help me how can i change language on one particular textbox on run time.
Regards,
Omar Lodhi
|
|
|
|
|
first you must know you can not install/uninstall language supports in windows itself. That means that you can only support these languages only if they are supported by the user's windows.
Now to the issue. You can handle two events to manage that: Enter , and Leave .
In the Enter event handler you set Application.CurrentInputLanguage property to whatever you want, then on Leave event handler you change it back to the original.
Regards
|
|
|
|