Click here to Skip to main content
15,891,905 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalretrieving e-mails from outlook Pin
MagicGirL8321-Mar-05 19:43
MagicGirL8321-Mar-05 19:43 
GeneralExplorer Bars Pin
micromause21-Mar-05 19:36
micromause21-Mar-05 19:36 
GeneralRe: Explorer Bars Pin
sumit2121-Mar-05 22:08
sumit2121-Mar-05 22:08 
GeneralRe: Explorer Bars Pin
Dave Kreskowiak22-Mar-05 0:41
mveDave Kreskowiak22-Mar-05 0:41 
GeneralRegistryKey GetType() help Pin
badcredit21-Mar-05 17:25
badcredit21-Mar-05 17:25 
GeneralRe: RegistryKey GetType() help Pin
Christian Graus21-Mar-05 17:37
protectorChristian Graus21-Mar-05 17:37 
GeneralRe: RegistryKey GetType() help Pin
Dave Kreskowiak22-Mar-05 0:29
mveDave Kreskowiak22-Mar-05 0:29 
GeneralDeleting an entry in datagrid Pin
Chaos Machine21-Mar-05 16:48
Chaos Machine21-Mar-05 16:48 
Hello everybody. I have the following problem. I can connect to a database with a datagrid and display all records. But when i go to delete one it doesn't do it.

Code for populating datagrid

Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\db1.mdb"
Dim myConnection As OleDbConnection = New OleDbConnection
myConnection.ConnectionString = connString
Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from tblDevices", myConnection)
Dim ds As DataSet = New DataSet
da.Fill(ds, "tblDevices")
Dim dv As DataView = ds.Tables("tblDevices").DefaultView
DataGrid1.DataSource = dv

code for deleting
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\db1.mdb"
Dim myConnection As OleDbConnection = New OleDbConnection
Dim cmd As OleDbCommand
myConnection.ConnectionString = connString
myConnection.Open()
Dim mySelectText As String = "Select * from tblDevices"
Dim myDataAdapter As New OleDbDataAdapter(mySelectText, myConnection)
myDataAdapter.DeleteCommand = New OleDbCommand("DELETE FROM tblDevices WHERE Item= '" & tempDevice & "' AND Booked= '" & txtBookedBy.Text & "' AND Date= '" & txtDate.Text & "' AND Time= '" & txtTime.Text & " '", myDataAdapter.SelectCommand.Connection)
myConnection.Close()

What am i doing wrong? WTF | :WTF:


Still trying to find the way
GeneralRe: Deleting an entry in datagrid Pin
sumit2121-Mar-05 21:03
sumit2121-Mar-05 21:03 
GeneralSMART with VB.NET Pin
Chaos Machine21-Mar-05 15:46
Chaos Machine21-Mar-05 15:46 
GeneralCountry Drop Down Pin
Jaydeanster21-Mar-05 14:52
Jaydeanster21-Mar-05 14:52 
GeneralRe: Country Drop Down Pin
Christian Graus21-Mar-05 15:01
protectorChristian Graus21-Mar-05 15:01 
QuestionHow to hide applications from task list on win NT/XP Pin
lamah21-Mar-05 11:01
lamah21-Mar-05 11:01 
AnswerRe: How to hide applications from task list on win NT/XP Pin
Dave Kreskowiak21-Mar-05 12:41
mveDave Kreskowiak21-Mar-05 12:41 
AnswerRe: How to hide applications from task list on win NT/XP Pin
sumit2121-Mar-05 22:12
sumit2121-Mar-05 22:12 
GeneralRe: How to hide applications from task list on win NT/XP Pin
Dave Kreskowiak22-Mar-05 0:12
mveDave Kreskowiak22-Mar-05 0:12 
QuestionHow to add tooltip text to a Button Pin
Suman Singh21-Mar-05 10:21
professionalSuman Singh21-Mar-05 10:21 
AnswerRe: How to add tooltip text to a Button Pin
Mitch F.21-Mar-05 11:53
Mitch F.21-Mar-05 11:53 
QuestionHow to close form1 from form3 Pin
Suman Singh21-Mar-05 10:19
professionalSuman Singh21-Mar-05 10:19 
AnswerRe: How to close form1 from form3 Pin
Dave Kreskowiak21-Mar-05 12:22
mveDave Kreskowiak21-Mar-05 12:22 
GeneralRe: How to close form1 from form3 Pin
Suman Singh21-Mar-05 12:35
professionalSuman Singh21-Mar-05 12:35 
GeneralRe: How to close form1 from form3 Pin
Dave Kreskowiak21-Mar-05 13:37
mveDave Kreskowiak21-Mar-05 13:37 
QuestionHow to perform an adodc1.recordset.find Pin
bhbadz200521-Mar-05 5:52
bhbadz200521-Mar-05 5:52 
Generalobtaining a RAS IP address Pin
Dahoolio21-Mar-05 3:18
Dahoolio21-Mar-05 3:18 
Questionhow to convert a NULL smalldatetime in sql query? Pin
Lisana21-Mar-05 2:42
Lisana21-Mar-05 2:42 

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.