Click here to Skip to main content
16,003,474 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Answercross-post Pin
Luc Pattyn14-Jun-10 3:55
sitebuilderLuc Pattyn14-Jun-10 3:55 
AnswerRe: USB drive reader Pin
Kschuler15-Jun-10 3:22
Kschuler15-Jun-10 3:22 
QuestionIssue: Deploy COM exposed .net dll Pin
alexvw12-Jun-10 6:51
alexvw12-Jun-10 6:51 
AnswerRe: Issue: Deploy COM exposed .net dll Pin
Abhinav S12-Jun-10 7:30
Abhinav S12-Jun-10 7:30 
GeneralRe: Issue: Deploy COM exposed .net dll Pin
alexvw12-Jun-10 7:54
alexvw12-Jun-10 7:54 
AnswerRe: Issue: Deploy COM exposed .net dll Pin
Eddy Vluggen12-Jun-10 23:01
professionalEddy Vluggen12-Jun-10 23:01 
GeneralRe: Issue: Deploy COM exposed .net dll Pin
alexvw13-Jun-10 4:06
alexvw13-Jun-10 4:06 
QuestionVb6 sybntax counterpart of VB.Net. Pin
priyamtheone12-Jun-10 6:33
priyamtheone12-Jun-10 6:33 
What's the VB6 counterpart of the following codes?

To insert a record in database with command object parameters:

dim strSql as string
strSql = "Insert Into tblEmployees (EmpName,DeptartmentID,JoinDate) Values ('" & _
txtName.Text & "'," & Val(cboDepartment.Value) & ",@JoinDate)"
com = CreateCommand(strSql)

com.Parameters.Add(New SqlParameter("@JoinDate", SqlDbType.DateTime))
If (dtpJoinDate.Checked) Then
	com.Parameters("@JoinDate").Value = Convert.ToDateTime(dtpJoinDate.Value)
Else
	com.Parameters("@JoinDate").Value = DBNull.Value
End If

If com.ExecuteNonQuery = 1 Then
	MsgBox("Record saved.")
End If


To obtain a record from database:
Dim drd As SqlDataReader
strSql = "Select EmpName,DeptID,JoinDate From tblEmployees Where EmpID=1001"
drd = CreateReader(strSql)
If drd.Read Then
	txtName.Text = drd("EmpName")
	cboDepartment.Value = drd("DepartmentID")

	If IsDBNull(drd("JoinDate")) Then
		dtpJoinDate.ResetText()
		dtpJoinDate.Checked = False
	Else
		dtpJoinDate.Value = drd("JoinDate")
	End If
End If
drd.Close()

AnswerRe: Vb6 sybntax counterpart of VB.Net. Pin
Abhinav S12-Jun-10 7:29
Abhinav S12-Jun-10 7:29 
AnswerRe: Vb6 sybntax counterpart of VB.Net. Pin
Anshul R12-Jun-10 19:10
Anshul R12-Jun-10 19:10 
GeneralRe: Vb6 sybntax counterpart of VB.Net. Pin
Eddy Vluggen12-Jun-10 21:49
professionalEddy Vluggen12-Jun-10 21:49 
AnswerRe: Vb6 sybntax counterpart of VB.Net. Pin
Eddy Vluggen12-Jun-10 21:48
professionalEddy Vluggen12-Jun-10 21:48 
QuestionRe: Vb6 sybntax counterpart of VB.Net. Pin
priyamtheone14-Jun-10 6:25
priyamtheone14-Jun-10 6:25 
AnswerRe: Vb6 sybntax counterpart of VB.Net. Pin
Eddy Vluggen14-Jun-10 8:25
professionalEddy Vluggen14-Jun-10 8:25 
QuestionRe: Vb6 sybntax counterpart of VB.Net. Pin
priyamtheone17-Jun-10 5:37
priyamtheone17-Jun-10 5:37 
AnswerRe: Vb6 sybntax counterpart of VB.Net. Pin
Eddy Vluggen17-Jun-10 22:46
professionalEddy Vluggen17-Jun-10 22:46 
QuestionHelp with a code I can't seem to get work Pin
John McMahon11-Jun-10 7:02
John McMahon11-Jun-10 7:02 
AnswerRe: Help with a code I can't seem to get work Pin
Kschuler11-Jun-10 7:29
Kschuler11-Jun-10 7:29 
GeneralRe: Help with a code I can't seem to get work Pin
John McMahon11-Jun-10 7:31
John McMahon11-Jun-10 7:31 
GeneralRe: Help with a code I can't seem to get work Pin
John McMahon11-Jun-10 7:33
John McMahon11-Jun-10 7:33 
GeneralRe: Help with a code I can't seem to get work Pin
Wes Aday11-Jun-10 7:41
professionalWes Aday11-Jun-10 7:41 
GeneralRe: Help with a code I can't seem to get work Pin
John McMahon11-Jun-10 7:42
John McMahon11-Jun-10 7:42 
QuestionStop formatting of datagridview cell [solved] Pin
chrispowell1234511-Jun-10 1:01
chrispowell1234511-Jun-10 1:01 
AnswerRe: Stop formatting of datagridview cell Pin
Wayne Gaylard11-Jun-10 1:30
professionalWayne Gaylard11-Jun-10 1:30 
GeneralRe: Stop formatting of datagridview cell Pin
chrispowell1234511-Jun-10 3:01
chrispowell1234511-Jun-10 3:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.