SQL-Server Parameters

  • Thread starter Thread starter Dale
  • Start date Start date
D

Dale

Can anyone out there give me an example of passing SQL-
Server parameters in VB.NET? Please?

Thanx.
 
Thanx Rob. That's a part of what I need, but I think I
need a step further back.

I'm new to the whole .NET thing and really don't
understand dataAdapters, dataSets and dataBinding as of
yet.

What I need to do is simply take the information in some
text boxes and pass it to a stored procedure. This was
how I was going to insert a new record (or update an
existing one).

However, if data binding is a better option I'd go that
route, but need a quick lesson if possible.

Either solution would be helpful.

Thanx.

Dale
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dale,

This is what I did to take the items selected in some ComboBoxes and
pass their SelectedValue to a SQL statement to filter a DataSet:

The SQL statement in the DataAdapter.SelectCommand.CommandText

SELECT
DISTINCT VerseText,
BookID AS BookKey,
ChapterID AS ChapterKey,
VerseID AS VerseKey,
ID
FROM
tblVerseText
WHERE
(VerseID = ?) AND
(ChapterID = ?) AND
(BookID = ?)
- -----------------------------------

The code executed to take the ValueMember and pass it to the SQL
statement:
daText.SelectCommand.Parameters("BookID").Value =
cmbBook.SelectedValue

daText.SelectCommand.Parameters("ChapterID").Value =
cmbChapter.SelectedValue

daText.SelectCommand.Parameters("VerseID").Value =
cmbVerse.SelectedValue

- -----------------------------------

Hope this helps,

Gary

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.8 for non-commercial use <http://www.pgp.com>

iQA/AwUBP/IwNz8KnwrkurVSEQIIHwCg76M6IYiG/Dw0P1C91wjxRVLO/J0An0pW
McLJVXpa5mBIbgw3fYjGMozr
=Y72a
-----END PGP SIGNATURE-----
 
Back
Top