15,915,093 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 Member 13738315 (Top 18 by date)
Member 13738315
22-Apr-18 4:37am
View
I want to count the value of column. Count number of days in a column.
Member 13738315
19-Apr-18 3:03am
View
ok.. itry it... if you help me,,pls see my coding below...
Try
If Len(Trim(TextBox2.Text)) = 0 Then
MessageBox.Show("Please enter staff name", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
TextBox2.Focus()
Exit Sub
End If
If RadioButton1.Checked = False And RadioButton2.Checked = False Then
MessageBox.Show("Please select gender", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
Exit Sub
End If
If Len(Trim(TextBox3.Text)) = 0 Then
MessageBox.Show("Please enter father's name", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
TextBox3.Focus()
Exit Sub
End If
If Len(Trim(ComboBox1.Text)) = 0 Then
MessageBox.Show("Please select department", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
ComboBox1.Focus()
Exit Sub
End If
If Len(Trim(TextBox5.Text)) = 0 Then
MessageBox.Show("Please enter temporary address", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
TextBox5.Focus()
Exit Sub
End If
If Len(Trim(TextBox6.Text)) = 0 Then
MessageBox.Show("Please enter permanent address", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
TextBox6.Focus()
Exit Sub
End If
If Len(Trim(TextBox8.Text)) = 0 Then
MessageBox.Show("Please enter mobile no.", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
TextBox8.Focus()
Exit Sub
End If
If RadioButton1.Checked = True Then
Gender = RadioButton1.Text
End If
If RadioButton2.Checked = True Then
Gender = RadioButton2.Text
End If
conn = New SqlConnection(Connstring)
conn.Open()
sqlstring = "insert into Staff([Staff Id], [Staff Name}, [Father Name],DateOfJoining, Department, [Temporary Address], [Permanent Address], DOB, [Phone No], [Mobile No], [Email Id], Photo,Gender) VALUES('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox3.Text & "',#" & DateTimePicker1.Text & "#,'" & ComboBox1.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & DateTimePicker2.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & "',@image,'" & Gender & "'"
cmd = New SqlCommand(sqlstring, conn)
cmd.Connection = conn
Dim ms As New MemoryStream()
Dim bmpImage As New Bitmap(PictureBox1.Image)
bmpImage.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim data As Byte() = ms.GetBuffer()
Dim p As New SqlParameter("@image", SqlDbType.VarBinary)
p.Value = data
cmd.Parameters.Add(p)
cmd.ExecuteNonQuery()
cmd.Dispose()
conn.Close()
MessageBox.Show("Successfully saved", " Staff Record", MessageBoxButtons.OK, MessageBoxIcon.Information)
Button3.Enabled = False
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Member 13738315
15-Apr-18 3:43am
View
ok bro...thanks...what is the mean by BOM. how to delared it..
Member 13738315
15-Apr-18 3:07am
View
no, it have not prb with columns..it in rows...i think the end of the coding must have the looping statement. it can insert the first row details(Staff Id, Staff Name, Status, Date) in database..But cannot insert second and another columns of datagridview values...lets tell about this placed looping statement..pls..
Member 13738315
15-Apr-18 3:04am
View
No, i dont have prb in columns ,it is rows. Actually the datagridview first row can be added. It insert the first row( staffName, StaffId, Status, and date). But it cannot insert the 2nd and another rows details...i think end of the coding must have looping statements..lets tell about it...
Member 13738315
14-Apr-18 10:08am
View
I got it...bro
Member 13738315
14-Apr-18 8:35am
View
I discoverd this command...but small error...pls see this,,
sqlstring = "INSERT INTO dbo.Attend1(StaffId, StaffName) VALUES ('" & dr.Cells(0).Value & "','" & dr.Cells(1).Value & "')"
Error: 'dr' not declared..How to declare it..
Member 13738315
14-Apr-18 7:35am
View
it is worked. But i mean "value1" is first column(StaffId) in the DataGridview data. I worked with Attendance System. so, 1)i need to select and display from the staff table in database. 2) with combobox, i marked present or obsent , staffName, StaffId and Present or obsent values stored in another table which is Attend1. First problem is solved. But second problem is sloved half and half. Because i represet 'Value1' is Staffid or first column of datgridview.pls guide me....
Member 13738315
14-Apr-18 7:16am
View
do you represent space between variable names?
Member 13738315
14-Apr-18 7:15am
View
what is the different from my coding to your coding. it is same as my coding. I can't understand . pls tell me....
Member 13738315
14-Apr-18 5:47am
View
thanks bro...can tell me the same code in sql server 2008 and vb.net....pls bro
Member 13738315
10-Apr-18 7:46am
View
pls send me the coding for same problem in vb.net. I want to display the data from database to lables for attendance form. Because i registered new student details, the attendance form should be add the student name, idno automataically that are displayed in lables dynamically. Another one attendance form each student detail have a combobox for mark the attendance present or opsent. i think you did understand.pls give me the code for attendance.pls help me...
Member 13738315
10-Apr-18 7:46am
View
pls send me the coding for same problem in vb.net. I want to display the data from database to lables for attendance form. Because i registered new student details, the attendance form should be add the student name, idno automataically that are displayed in lables dynamically. Another one attendance form each student detail have a combobox for mark the attendance present or opsent. i think you did understand.pls give me the code for attendance.pls help me...
Member 13738315
10-Apr-18 7:27am
View
because i worked Attendance form. I registered new staff details in regform, the staff details should be display in the attendance form to mark the attendance. So i need solve the problem.
Member 13738315
10-Apr-18 7:25am
View
no bro.. i dont know display the data from database to dynamic labels
Member 13738315
10-Apr-18 7:21am
View
If Len(Trim(ComboBox1.Text)) = 0 Then
MessageBox.Show("Please select user type", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
ComboBox1.Focus()
Exit Sub
End If
If Len(Trim(TextBox1.Text)) = 0 Then
MessageBox.Show("Please enter user name", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
TextBox1.Focus()
Exit Sub
End If
If Len(Trim(TextBox2.Text)) = 0 Then
MessageBox.Show("Please enter password", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
TextBox2.Focus()
Exit Sub
End If
Try
Dim myConnection As OleDbConnection
myConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Attendance.mdb.accdb;Persist Security Info=False;")
Dim myCommand As OleDbCommand
myCommand = New OleDbCommand("SELECT users.username,User_password FROM Users,Registration where Registration.Username=users.username and Users.Username = @Username and user_password = @UserPassword", myConnection)
Dim uName As New OleDbParameter("@Username", SqlDbType.VarChar)
Dim uPassword As New OleDbParameter("@UserPassword", SqlDbType.VarChar)
uName.Value = TextBox1.Text
uPassword.Value = TextBox2.Text
myCommand.Parameters.Add(uName)
myCommand.Parameters.Add(uPassword)
myCommand.Connection.Open()
Dim myReader As OleDbDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
Dim Login As Object = 0
If myReader.HasRows Then
myReader.Read()
Login = myReader(Login)
End If
If Login = Nothing Then
MsgBox("Login is Failed...Try again !", MsgBoxStyle.Critical, "Login Denied")
TextBox1.Clear()
TextBox2.Clear()
TextBox1.Focus()
Else
ProgressBar1.Visible = True
ProgressBar1.Maximum = 5000
ProgressBar1.Minimum = 0
ProgressBar1.Value = 4
ProgressBar1.Step = 1
For i = 0 To 5000
ProgressBar1.PerformStep()
Next
Me.Hide()
Me.Label1.Hide()
Me.TextBox1.Hide()
Me.Label2.Hide()
Me.TextBox2.Hide()
Me.Button1.Hide()
Me.Button2.Hide()
Me.LinkLabel1.Hide()
Me.Label3.Hide()
Me.Label6.Hide()
Me.ComboBox1.Hide()
Main.Show()
End If
myCommand.Dispose()
myConnection.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
This is my coding bro...but i dont know how to mentiooned condition to two types of usertype login opened two different forms.
Member 13738315
10-Apr-18 7:18am
View
s bro
Member 13738315
10-Apr-18 4:58am
View
pls give the coding for attendance form in vb.net.not asp.net. pls help me
Show More