473,386 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

SQL-Server Parameters

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

Thanx.
Nov 20 '05 #1
3 1014
Dale,

Take a look here:

http://msdn.microsoft.com/library/en...erCommands.asp

Hope this helps.

Rob Panosh

"Dale" <dk*****@infometricsconsulting.com> wrote in message
news:02****************************@phx.gbl...
Can anyone out there give me an example of passing SQL-
Server parameters in VB.NET? Please?

Thanx.

Nov 20 '05 #2
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
-----Original Message-----
Dale,

Take a look here:

http://msdn.microsoft.com/library/en- us/vbcon/html/vbconParametersInDataAdapterCommands.asp
Hope this helps.

Rob Panosh

"Dale" <dk*****@infometricsconsulting.com> wrote in messagenews:02****************************@phx.gbl...
Can anyone out there give me an example of passing SQL-
Server parameters in VB.NET? Please?

Thanx.


Nov 20 '05 #3
-----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-----
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: george lewycky | last post by:
I am trying to take a field description for a column of about 200+ bytes and wrap the field into 3 lines of 70 bytes apiece in PL/SQL!!!!!! I know this can be done in SQL*Plus as show below but...
2
by: Peter | last post by:
I run most of my SQL scripts via kornshell on AIX. I use the "here-document" to run some of the smaller ones. Example: #!/bin/ksh # Analyze the table. sqlplus...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
3
by: Ira Baxter | last post by:
Hi. We are working on tools to process PL/SQL code. What we need are precise details on the full PL/SQL syntax. We have the Oracle 9/10 documentation, but it seems a little fuzzy on the...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
6
by: sghi | last post by:
Hi All, I'm new to this group and quite new to access/vba. So, shortly after beginning to write a simple application for my wife, I came across a blocking problem: I need to intercept the sql...
0
by: Medhatithi | last post by:
Hi, I have been in several ways benefiited from this site. I would like to share some sql tuning techniques(simple, but effective) with you all. SQL Tuning Tips Oracle Tips Session #6 ...
4
by: arial | last post by:
Hi all, Need your help again. string sql = " select "; sql += " q.ID, q.PALMNAME, q.CB_COMPLET, q.CMPLT_TIME, q.UNIT_NAME,"; sql += " q.CB_CREW1, q.CRW1_NAME, q.CRW1_CERT, q.CB_CREW2,...
5
by: dbrother | last post by:
Access 2003 Win XP Pro SP3 Using SQL /ADO Recordsets in a Do Loop Hello, I'm using a random number generator based on an integer input from a user from a form that will get X number of random...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.