16,016,263 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 .NET 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 sohail awr (Top 21 by date)
sohail awr
4-Apr-14 12:43pm
View
Private Sub DataGridView1_RowStateChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowStateChangedEventArgs) Handles DataGridView1.RowStateChanged
If Me.DataGridView1.Rows.Count > 0 Then
If Me.DataGridView1.SelectedRows.Count > 0 Then
Me.TextBox2.Text = e.Row.Index
End If
End If
End Sub
sohail awr
25-Mar-14 14:04pm
View
You can use 2 timers 1st will check the IsConnectionAvailable() and 2nd will send the mails.
In your function IsConnectionAvailable()
Use condition
If IsConnectionAvailable() = True then
Timer2.Start()
else
Timer2.Stop()
End if
On Timer1 Tick event
Call IsConnectionAvailable()
On Timer2 Tick Event
Call Sendmail()
Also remember the Timer interval you should define in timer properties not on page load event.
sohail awr
25-Mar-14 11:32am
View
Your above PDF file "AOTD_SU_20131118_006.pdf" should placed there
sohail awr
25-Mar-14 11:16am
View
Normally for INT Column return value will be 0 but if you want to send null value for INT Column use this method.
oCom.CommandText = "Update emp_attendance set Present_Absent = " & IIf(Me.DataGridView1.Item(1, i).Value = "", "Null", Me.DataGridView1.Item(1, 0).Value) & " where emp_id=2"
sohail awr
25-Mar-14 9:03am
View
have you created the folder named "PDFs" in your solution. Because I have displayed the pdf through above code.
sohail awr
22-Mar-14 12:27pm
View
First you should give your sample code where you have used the timer. After I will be able give exact solution.
sohail awr
21-Mar-14 9:59am
View
Crystal Reports Basic for Visual Studio 2008
SQL Server 2005 Express Edition SP2
sohail awr
21-Mar-14 9:52am
View
First you tell your app.config connection string so that I will be able to understand what do you want.
sohail awr
21-Mar-14 5:57am
View
ok
sohail awr
21-Mar-14 5:53am
View
Deleted
You should include Crystal Report Viewer and SQL Server Express as prerequisites according your versions i.e. 2008
sohail awr
17-Mar-14 2:15am
View
I am trying and soon it will be done.
sohail awr
6-Mar-14 9:13am
View
Actually as you know the column and row counting starts with 0 not 1 If your first column is auto generated then you should give column(1) for your column 2.
As have posted update/Delete/Save Command
If you have enabled your grid properties for Edit/Add Row then
For Inserting new record add the values in Last line and don't change the line before saving the record (it means click on save button)
If you edit your previous record then click on update button before changing the line.
sohail awr
6-Mar-14 9:10am
View
If you starts from second column you should use in where condition:
Me.DataGridView1.Columns(1).HeaderText & "=" & Me.DataGridView1.CurrentRow.Cells(1).Value
Also please vote for my code....
sohail awr
5-Mar-14 9:39am
View
The main reason is in Attendance date field. So check your table emp_attendance - att_date
It its data type is datetime so change it to date. If again this error occurs so change it as varchar(10).
I have seen screen shot where you can see why query is failed due to Conversion from date time to string.
sohail awr
3-Mar-14 10:41am
View
I am unable to view your video. you just drop an error screen shot as image so I will be able to find it. But I am giving some steps you use these steps and try the above code.
Step - 1
Create a Database Named: MyDatabase
Step - 2
Copy and paste of Create Table Query both queries step by step and execute it.
After you have successfully created tables.
Insert some data in mst_employees table manually. The table emp_attendance should be empty.
Step - 3
Create a form in your solution Named Form7
Add following controls in the form
1. One Datagridview Named 'Datagridview1' with 7 columns the last column should be Checkbox Column
2. Add Two Buttons - Named 'btn_submit' and 'btn_checkall'
Now Copy the above form7 code and paste it on your Form7 code remember first remove all lines available in the code section of your form7 then paste my code.
Now build your solution if any errors found then drop your error sreenshot so I will be able to give more help.
sohail awr
28-Feb-14 7:42am
View
Deleted
I have checked your code there is no problem which you have wrote.. I have only remark the line of varMode because I have not understand why you have use this..
Private Sub DataGridView1_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEnter
DataGridView1.BeginEdit(True)
'If varMode = 1 Or varMode = 2 Then
If DataGridView1.Rows(e.RowIndex).Cells(Me.ComboColumn6.Name).Selected = True Then
DirectCast(DataGridView1.EditingControl, DataGridViewComboBoxEditingControl).DroppedDown = True
End If
'End If
End Sub
sohail awr
25-Feb-14 9:23am
View
Imports System.Data
Imports System.Data.OleDb
Public Class _01_TAILOR_SETUP
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DB.accdb")
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter
Dim ds As DataSet
Private Sub _01_TAILOR_SETUP_FormClosed(ByVal sender As Object, ByVal e As FormClosedEventArgs) Handles Me.FormClosed
End Sub
Private Sub _01_TAILOR_SETUP_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs) Handles Me.FormClosing
Dim result As DialogResult = MsgBox("do you want to close?", MsgBoxStyle.YesNo)
If result = Windows.Forms.DialogResult.Yes Then
e.Cancel = True
_00_MAIN.Show()
Me.Hide()
ElseIf result = Windows.Forms.DialogResult.No Then
e.Cancel = True
End If
End Sub
Private Sub _01_TAILOR_SETUP_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("Available")
ComboBox1.Items.Add("Terminated")
ComboBox1.Items.Add("Both")
fill_grid() 'Use this type of trick so it will reduce your lines of code.
End Sub
Private Sub ComboBox1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs) Handles ComboBox1.KeyDown
If e.KeyCode = Keys.Escape Then
If TextBox1.Text = "" And TextBox2.Text = "" And TextBox3.Text = "" And ComboBox1.Text = "Select value" Then
MsgBox("Fill appropriate values")
TextBox3.Focus()
Else
Dim result As DialogResult = MsgBox("Do you want to save", MsgBoxStyle.YesNo)
If result = Windows.Forms.DialogResult.Yes Then
con.Open()
cmd = New OleDbCommand("INSERT INTO Tailor (TCODE, TNAME, TADDRESS,STATUS) VALUES ('" & TextBox3.Text & "', '" & TextBox2.Text & "', '" & TextBox1.Text & "', '" & ComboBox1.Text & "');", con)
cmd.ExecuteNonQuery()
MsgBox("INSERTED")
fill_grid() 'Use this type of trick so it will reduce your lines of code.
ElseIf result = Windows.Forms.DialogResult.No Then
End If
End If
End If
End Sub
Sub fill_grid()
If con.State = ConnectionState.Closed Then
con.Open()
End If
da = New OleDbDataAdapter("Select * from Tailor", con)
ds = New DataSet()
da.Fill(ds, "tailor")
DataGridView1.DataSource = ds.Tables(0)
con.Close()
End Sub
Private Sub btn_delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_delete.Click
If Me.DataGridView1.SelectedRows.Count > 0 Then
If con.State = ConnectionState.Closed Then
con.Open()
End If
cmd = New OleDbCommand("Delete * from Tailor where TCODE='" & Me.DataGridView1.SelectedRows(0).Cells(0).Value & "'", con)
cmd.ExecuteNonQuery()
MsgBox("Recodrd Deleted!")
fill_grid()
con.Close()
End If
End Sub
End Class
sohail awr
21-Feb-14 8:19am
View
First Select your table from your database in which you want to set trigger.
--- Trigger works on each record
I have defined Trigger Name as Trigger1
My Master table is Sales (You can use your master table)
Event I have used (AFTER/BEFORE) any one you can use.
Make a new Reminder Table as Table_2 or any name you can give, Entity Name I have given as 'test1' you can use any other name.
In values I have used DateAdd function. 1 parameter is Day , how much day you want to add, your invoice date I used default system date
sohail awr
19-Feb-14 7:39am
View
While your second column name is 'rollno' so how can you 'order by sroll'. Please give exact name of your 2nd column so that your data will be sorted out automatically.
****
If you are selecting data like (Select name + ' ' + rollno + ' ' + subject as test1 from table1 order by rollno) it will also give sorted result.
****
If you want to sort data by two or more columns so use this query
Select * from table1 order by rollno, name
sohail awr
19-Feb-14 7:31am
View
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds As New DataSet
Dim i As Integer = 0
ds = selectdata("Select * from mst_members")
If ds.Tables(0).Rows.Count > 0 Then
While (i <> ds.Tables(0).Rows.Count)
Me.DataGrid1.Rows.Add()
Me.DataGrid1.Item(0, i).Value = ds.Tables(0).Rows(i).Item("account_no").ToString
Me.DataGrid1.Item(1, i).Value = ds.Tables(0).Rows(i).Item("member_name").ToString
i = i + 1
End While
End If
i = 0
ds.Clear()
End Sub
Public Function selectdata(ByVal str As String) As DataSet
If oCon.State = ConnectionState.Closed Then
oCon.Open()
End If
Dim cmd As New OleDbCommand(str, oCon)
Dim da As New OleDbDataAdapter(cmd)
Dim ds As New DataSet("bpl")
Try
da.Fill(ds, "bpl")
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
oCon.Close()
End Try
Return ds
End Function
sohail awr
15-Feb-14 4:31am
View
In summary table InvoiceID define as Primary Key
and In Transaction Table InvoiceID and ItemID are FKey
Show More