Click here to Skip to main content
15,884,425 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Help Me Pin
dan!sh 29-Jun-09 19:16
professional dan!sh 29-Jun-09 19:16 
GeneralRe: Help Me Pin
hamed200929-Jun-09 21:38
hamed200929-Jun-09 21:38 
AnswerRe: Help Me Pin
Christian Graus30-Jun-09 0:16
protectorChristian Graus30-Jun-09 0:16 
GeneralRe: Help Me Pin
dan!sh 30-Jun-09 0:21
professional dan!sh 30-Jun-09 0:21 
GeneralRe: Help Me Pin
Christian Graus30-Jun-09 10:34
protectorChristian Graus30-Jun-09 10:34 
QuestionImage reference Pin
jhp53129-Jun-09 17:22
jhp53129-Jun-09 17:22 
AnswerRe: Image reference Pin
jhp53130-Jun-09 0:17
jhp53130-Jun-09 0:17 
QuestionDropdown box display issue in vb .net Pin
Member 451421829-Jun-09 17:04
Member 451421829-Jun-09 17:04 
Hello friends

I have two radio buttons view and insert the view radio button display dropdown box, the dropdown box display the records retrieved from the database and displayed.

(i) The first index is empty and the rest of the index is filled with the retrieved data i need the data to be displayed starting the first index.

(ii) When i switch between the view and insert radio button and back to view radio button the data in the dropdown box is doubled for each of the above mentioned cycle


Code:
-----


Public Class Form1
Dim Conn As SqlConnection
Dim Cmd As SqlCommand



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Conn = New SqlConnection
Cmd = New SqlCommand
Conn.ConnectionString = "Data Source=PERSONAL-A0CC22\SQLEXPRESS;Initial Catalog=personal;Integrated Security=True"

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If (StudentId.Text = "" Or Fname.Text = "" Or Lname.Text = "" Or Address.Text = "" Or Mobile.Text = "" Or EmailId.Text = "") Then
Label1.Text = "Fill In All The Fields"
Label1.Visible = True
Else
Conn.Open()
Cmd = Conn.CreateCommand()
Cmd.CommandText = "Insert into student values('" + StudentId.Text + "', '" + Fname.Text + "', '" + Lname.Text + "', '" + Address.Text + "', '" + Mobile.Text + "', '" + EmailId.Text + "')"
Cmd.ExecuteNonQuery()
StudentId.Text = ""
Fname.Text = ""
Lname.Text = ""
Address.Text = ""
Mobile.Text = ""
EmailId.Text = ""
Label1.Visible = True
Label1.Text = "Data Have Been Stored Sucessfully"
Conn.Close()
End If
End Sub



Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
TStudentId.Visible = True
StudentId.Visible = False
Button1.Visible = False
Button2.Visible = True
Button3.Visible = True
Dim i As Integer
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Dim dt As New DataTable
Conn.Open()
Cmd = Conn.CreateCommand
Cmd.CommandText = "Select StudentId from Student"
da.SelectCommand = Cmd
da.Fill(ds, "Student")
dt = ds.Tables("Student")
For i = 0 To dt.Rows.Count - 1
TStudentId.Items.Add(dt.Rows(i).Item(0))
Next
Fname.Text = ""
Lname.Text = ""
Address.Text = ""
Mobile.Text = ""
EmailId.Text = ""
Conn.Close()
End Sub
AnswerRe: Dropdown box display issue in vb .net Pin
Henry Minute30-Jun-09 2:50
Henry Minute30-Jun-09 2:50 
QuestionDeveloping on WinXP & Office 2003, targeting WinServer2008 & Office 2007 - getting "Retrieving the COM class factory..." error Pin
Daniel Boling29-Jun-09 11:26
Daniel Boling29-Jun-09 11:26 
AnswerRe: Developing on WinXP & Office 2003, targeting WinServer2008 & Office 2007 - getting "Retrieving the COM class factory..." error Pin
Christian Graus29-Jun-09 13:21
protectorChristian Graus29-Jun-09 13:21 
AnswerRe: Developing on WinXP & Office 2003, targeting WinServer2008 & Office 2007 - getting "Retrieving the COM class factory..." error Pin
EliottA29-Jun-09 13:53
EliottA29-Jun-09 13:53 
GeneralRe: Developing on WinXP & Office 2003, targeting WinServer2008 & Office 2007 - getting "Retrieving the COM class factory..." error Pin
Daniel Boling30-Jun-09 2:41
Daniel Boling30-Jun-09 2:41 
GeneralRe: Developing on WinXP & Office 2003, targeting WinServer2008 & Office 2007 - getting "Retrieving the COM class factory..." error Pin
EliottA30-Jun-09 2:48
EliottA30-Jun-09 2:48 
QuestionMS VB 2008 express, install for all users Pin
Jesper hoegh29-Jun-09 9:12
Jesper hoegh29-Jun-09 9:12 
AnswerRe: MS VB 2008 express, install for all users Pin
Dave Kreskowiak29-Jun-09 9:45
mveDave Kreskowiak29-Jun-09 9:45 
Questionmake limit time to the vedio capture Pin
my30name29-Jun-09 5:31
my30name29-Jun-09 5:31 
AnswerRe: make limit time to the vedio capture Pin
garfield18529-Jun-09 5:34
garfield18529-Jun-09 5:34 
GeneralRe: make limit time to the vedio capture [modified] Pin
my30name29-Jun-09 22:56
my30name29-Jun-09 22:56 
QuestionString$ function Pin
garfield18529-Jun-09 5:12
garfield18529-Jun-09 5:12 
AnswerRe: String$ function Pin
Nagy Vilmos29-Jun-09 5:35
professionalNagy Vilmos29-Jun-09 5:35 
AnswerRe: String$ function Pin
Luc Pattyn29-Jun-09 5:35
sitebuilderLuc Pattyn29-Jun-09 5:35 
GeneralRe: String$ function Pin
garfield18529-Jun-09 5:46
garfield18529-Jun-09 5:46 
GeneralRe: String$ function Pin
Luc Pattyn29-Jun-09 7:00
sitebuilderLuc Pattyn29-Jun-09 7:00 
Questioncrystal report problem in after installation ? Pin
JC.KaNNaN29-Jun-09 4:44
JC.KaNNaN29-Jun-09 4:44 

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.