Click here to Skip to main content
15,894,017 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDatatable.Select Problem Pin
eatwork26-Jul-06 5:51
eatwork26-Jul-06 5:51 
NewsCaedo HTTPd Web Server Pin
steve_ino26-Jul-06 5:40
steve_ino26-Jul-06 5:40 
QuestionCrystal reports. Pin
ImranIBM26-Jul-06 5:11
ImranIBM26-Jul-06 5:11 
AnswerRe: Crystal reports. Pin
Muhammad Jawad26-Jul-06 5:50
Muhammad Jawad26-Jul-06 5:50 
GeneralRe: Crystal reports. [modified] Pin
ImranIBM26-Jul-06 6:03
ImranIBM26-Jul-06 6:03 
Questionac Pin
70's live!26-Jul-06 5:08
70's live!26-Jul-06 5:08 
QuestionIcon loading for listviews (.ico files) Pin
Oneiroid26-Jul-06 4:59
Oneiroid26-Jul-06 4:59 
QuestionSave data in a SQL Database Pin
Fitschen26-Jul-06 4:20
Fitschen26-Jul-06 4:20 
Hi to all,
I want to save my data from a textbox in the database with a DataAdapter.
tbEingabeKomp is my TextBox, SqlDAKomponente my DataAdapter, SqlConnMesswerte my Connection
The DataAdapter has a Connection to the Database.

This code doesn't work.. and I dont know why

1st Code snipped
<br />
Me.SqlDAKomponente.InsertCommand.CommandText = "INSERT INTO tKomponente (name) VALUES (@Name)"<br />
Me.SqlDAKomponente.InsertCommand.Parameters.Add("@Name", Me.tbEingabeKomp.Text)<br />
<br />
Me.DataSetKomponente.AcceptChanges()<br />
<br />
Me.SqlConnMesswerte.Open()<br />
Me.SqlDAKomponente.Update(Me.DataSetKomponente.Tables.Item("tblKomponente"))<br />
Me.SqlConnMesswerte.Close()<br />


This code works, but I want to use the DataAdapter
2nd Code snipped
<br />
'create insert command<br />
Dim insCmd As SqlCommand<br />
insCmd = New SqlCommand("INSERT INTO tKomponente(name) VALUES(@name)", Me.SqlConnMesswerte)<br />
insCmd.Parameters.Add("@name", Me.tbEingabeKomp.Text)<br />
<br />
insCmd.Connection.Open()<br />
insCmd.ExecuteNonQuery()<br />
insCmd.Connection.Close()<br />


Could anybody help me to solve this problem?

TIA
Holger
QuestionVB 6.0 SEARCHING CODE Pin
michael cheche26-Jul-06 3:02
michael cheche26-Jul-06 3:02 
AnswerRe: VB 6.0 SEARCHING CODE Pin
mr_lasseter26-Jul-06 6:05
mr_lasseter26-Jul-06 6:05 
QuestionLetter pack [modified] Pin
PixelPixie26-Jul-06 2:53
PixelPixie26-Jul-06 2:53 
Questionone to one milion conversion of numbers into words?? Pin
Brian Jay26-Jul-06 2:50
Brian Jay26-Jul-06 2:50 
AnswerRe: one to one milion conversion of numbers into words?? Pin
Dave Sexton26-Jul-06 4:53
Dave Sexton26-Jul-06 4:53 
AnswerRe: one to one milion conversion of numbers into words?? Pin
Nouvand3-Aug-06 23:55
Nouvand3-Aug-06 23:55 
QuestionForm to stay with a MDI Form [modified] Pin
directred26-Jul-06 1:25
directred26-Jul-06 1:25 
AnswerRe: Form to stay with a MDI Form Pin
Zahid Hayat26-Jul-06 2:11
Zahid Hayat26-Jul-06 2:11 
Questionvariable with databinding [modified] Pin
Smithers-Jones26-Jul-06 0:08
Smithers-Jones26-Jul-06 0:08 
AnswerRe: variable with databinding Pin
mr_lasseter26-Jul-06 6:01
mr_lasseter26-Jul-06 6:01 
Questiontabcontrol Pin
Smithers-Jones26-Jul-06 0:05
Smithers-Jones26-Jul-06 0:05 
AnswerRe: tabcontrol Pin
Christian Graus26-Jul-06 1:52
protectorChristian Graus26-Jul-06 1:52 
QuestionBinding the data Pin
slSoftware25-Jul-06 22:46
slSoftware25-Jul-06 22:46 
AnswerRe: Binding the data Pin
Christian Graus26-Jul-06 1:50
protectorChristian Graus26-Jul-06 1:50 
GeneralRe: Binding the data Pin
slSoftware26-Jul-06 18:34
slSoftware26-Jul-06 18:34 
GeneralRe: Binding the data Pin
Christian Graus26-Jul-06 19:55
protectorChristian Graus26-Jul-06 19:55 
QuestionEvents Calling Pin
microuser_200025-Jul-06 21:56
microuser_200025-Jul-06 21:56 

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.