Click here to Skip to main content
15,908,834 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Imports Microsoft.Win32.security Problem Pin
chrischome6-Nov-07 10:18
chrischome6-Nov-07 10:18 
GeneralRe: Imports Microsoft.Win32.security Problem Pin
Colin Angus Mackay6-Nov-07 10:24
Colin Angus Mackay6-Nov-07 10:24 
QuestionDataGridView Column Order Display Index Issue Pin
Kschuler6-Nov-07 8:44
Kschuler6-Nov-07 8:44 
Questionheadset mic Pin
break_day6-Nov-07 7:54
break_day6-Nov-07 7:54 
AnswerRe: headset mic Pin
Christian Graus6-Nov-07 8:53
protectorChristian Graus6-Nov-07 8:53 
Questionmy dataset isnot refreshing [modified] Pin
Motajo Tolu6-Nov-07 7:03
professionalMotajo Tolu6-Nov-07 7:03 
AnswerRe: my oledbdataadapter isnot refreshing Pin
Kschuler6-Nov-07 7:09
Kschuler6-Nov-07 7:09 
GeneralRe: my oledbdataadapter isnot refreshing Pin
Motajo Tolu6-Nov-07 9:57
professionalMotajo Tolu6-Nov-07 9:57 
I am using textboxes to display the data and a navigator to browse through it. but the dataset cant pick up the newly updated record unless i restart my application.

this is the code i use to insert data in the database. I'll try and keep it short by just giving you the insert statement.

mycmd = "Insert into Assets(AssetID,AssetDescription,AssetCategory,Department,DateAcquired,Cost,ModelNumber,DepreciationPercent,MaintenanceType,comment,Location) Values ('" & assetId & "','" & assetdescription & "', '" & assetcategory & "', '" & department & "', #" & dateacquired & "#, '" & costprice & "', '" & modelnumber & "', '" & depreciation & "', '" & maintenancetype & "', '" & comment & "','" & location & "')"
conn.Open()
mycommand.Connection = conn
mycommand.CommandText = mycmd
myadapter.InsertCommand = mycommand
myadapter.InsertCommand.ExecuteNonQuery()
conn.Close()

and this is the code i use to retrieve the data from the database.


Try
DsAsets1.Clear()
OleDbDataAdapter1.Fill(DsAsets1)
count()
Catch ex As Exception
MsgBox(ex.ToString)
End Try

when I search for the data using the following code, I could see the data but the dataset can not pick it up

conn.Open()
Dim cmd As OleDbCommand = conn.CreateCommand()
cmd.CommandText = "SELECT AssetId, assetDescription, assetCategory, Department, DateAcquired, Cost, ModelNumber, DepreciationPercent, MaintenanceType, Comment,Location FROM Assets WHERE AssetID = '" + assetId + "'"
Dim reader As OleDbDataReader = cmd.ExecuteReader()
reader.Read()
If reader.HasRows Then
txtAssetNo.Text = (reader.GetString(0))
txtDescription.Text = (reader.GetString(1))
cmbCategory.Text = (reader.GetString(2))
cmbDepartment.Text = (reader.GetString(3))
dtpDateAcquired.Text = (reader.GetDateTime(4))
txtCostPrice.Text = (reader.GetDecimal(5))
txtModelNumber.Text = (reader.GetString(6))
txtDepreciation.Text = (reader.GetDecimal(7))
cmbMainType.Text = (reader.GetString(8))
txtComment.Text = (reader.GetString(9))
txtLocation.Text = (reader.GetString(10))
BindingNavigatorPositionItem.Text = 1
BindingNavigatorCountItem.Text = "of " & "{1}"
BindingNavigatorMovePreviousItem.Enabled = False
BindingNavigatorMoveNextItem.Enabled = False
txtFind.Text = ""

GeneralRe: my oledbdataadapter isnot refreshing Pin
Kschuler6-Nov-07 10:14
Kschuler6-Nov-07 10:14 
GeneralRe: my oledbdataadapter isnot refreshing Pin
Motajo Tolu6-Nov-07 10:47
professionalMotajo Tolu6-Nov-07 10:47 
Questionpassing string array to C++ fromVB.net Pin
xyhan6-Nov-07 6:22
xyhan6-Nov-07 6:22 
QuestionHow can i send text to another application textbox? Pin
IRBoy6-Nov-07 5:48
IRBoy6-Nov-07 5:48 
QuestionVB Form Pin
railay296-Nov-07 3:22
railay296-Nov-07 3:22 
Question,VB Form Pin
railay296-Nov-07 3:19
railay296-Nov-07 3:19 
QuestionSpeech to text Pin
Bismark Appah6-Nov-07 3:12
Bismark Appah6-Nov-07 3:12 
AnswerRe: Speech to text Pin
Guffa6-Nov-07 6:10
Guffa6-Nov-07 6:10 
GeneralRe: Speech to text Pin
Paul Conrad6-Nov-07 18:16
professionalPaul Conrad6-Nov-07 18:16 
QuestionVlookups in Excel Pin
nick46-Nov-07 0:57
nick46-Nov-07 0:57 
QuestionRegistry Accessing Pin
SekharOne5-Nov-07 22:37
SekharOne5-Nov-07 22:37 
AnswerRe: Registry Accessing Pin
AliAmjad5-Nov-07 23:08
AliAmjad5-Nov-07 23:08 
GeneralRe: Registry Accessing Pin
SekharOne11-Nov-07 20:06
SekharOne11-Nov-07 20:06 
QuestionCrystal Report 9 VB6 Pin
aqui_i5-Nov-07 22:01
aqui_i5-Nov-07 22:01 
QuestionIs OOPS concept in Visual Basic 6? Pin
KETAN K.5-Nov-07 21:27
KETAN K.5-Nov-07 21:27 
AnswerRe: Is OOPS concept in Visual Basic 6? Pin
Christian Graus5-Nov-07 22:09
protectorChristian Graus5-Nov-07 22:09 
AnswerRe: Is OOPS concept in Visual Basic 6? Pin
Guffa6-Nov-07 6:06
Guffa6-Nov-07 6:06 

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.