473,594 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

select stmt

In asp.net ,in command button script ,
How can i select and assign a value into a variable from a table.like
select ref into @var1 from table1 where id='1';
--
Thanks
Aug 7 '06 #1
3 1034
Shif,

The way your qeustion is made, gives often many misunderstandin gs, what kind
of table do you mean?

In the way you show it is it a DataBase table and by intance not a
datatable.

Cor

"shif" <ns*****@hotmai l.comschreef in bericht
news:D6******** *************** ***********@mic rosoft.com...
In asp.net ,in command button script ,
How can i select and assign a value into a variable from a table.like
select ref into @var1 from table1 where id='1';
--
Thanks

Aug 7 '06 #2
HI
Its a database table,
Dim comd As New SqlCommand()
comd.CommandTex t = "select barcode,ref from prod where supp_ref='" &
refBox.Text & "'"
this is an example which i am getting datainto a datatable and here records
are more,its working fine. now i want to get barcode,ref from the same table
and want to assign the values to two variables and only one record will fetch
at a time.
--
Thanks
"Cor Ligthert [MVP]" wrote:
Shif,

The way your qeustion is made, gives often many misunderstandin gs, what kind
of table do you mean?

In the way you show it is it a DataBase table and by intance not a
datatable.

Cor

"shif" <ns*****@hotmai l.comschreef in bericht
news:D6******** *************** ***********@mic rosoft.com...
In asp.net ,in command button script ,
How can i select and assign a value into a variable from a table.like
select ref into @var1 from table1 where id='1';
--
Thanks


Aug 7 '06 #3
Shif,

A very simple one,
http://www.vb-tips.com/dbpages.aspx?...6-7139b8970071

I hope this helps,

Cor

"shif" <ns*****@hotmai l.comschreef in bericht
news:F7******** *************** ***********@mic rosoft.com...
HI
Its a database table,
Dim comd As New SqlCommand()
comd.CommandTex t = "select barcode,ref from prod where supp_ref='" &
refBox.Text & "'"
this is an example which i am getting datainto a datatable and here
records
are more,its working fine. now i want to get barcode,ref from the same
table
and want to assign the values to two variables and only one record will
fetch
at a time.
--
Thanks
"Cor Ligthert [MVP]" wrote:
>Shif,

The way your qeustion is made, gives often many misunderstandin gs, what
kind
of table do you mean?

In the way you show it is it a DataBase table and by intance not a
datatable.

Cor

"shif" <ns*****@hotmai l.comschreef in bericht
news:D6******* *************** ************@mi crosoft.com...
In asp.net ,in command button script ,
How can i select and assign a value into a variable from a table.like
select ref into @var1 from table1 where id='1';
--
Thanks



Aug 7 '06 #4

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

Similar topics

5
3321
by: 73blazer | last post by:
Hello, I'm looking for a SQL syntax to put a variable name into the from clause. Specifically I have a colume in a table that is table name, and I want to use that result in the from clause in a select subquery ideally I'd like: ----- select coid,coid_ref from physical.ext ext where coid_ref not in (select coid from ext.coname) -----
2
2454
by: Andy S. | last post by:
Hi, I'm trying to declare and use temporary tables. I have written the following code in Java. Creating the tablespace (i can see the tablespace created using the Control Center), the temporary table and even inserting the values execute fine (even the executeUpdate while inserting returns a positive number indicating that rows have been inserted). However, when I select * from the temporary table, 0 rows are returned and the while loop...
10
7110
by: Antanas | last post by:
The problem is that when AddID is used multiple times in the same select statement, it returns the same value in all places. How could I force function AddID to increment OBJECTID sequence? Here is a basic sample of usage: SELECT AddID(), AddID(), AddID(), column1 from table1 Here is how AddID looks like:
4
4879
by: don.fleming | last post by:
Hi folks: Am doing a VBA SQL Select stmt with multiple rows found and not getting RecordCount > 1. I've verified there are multiple rows found by copying my SQL stmt from Debug window and pasting it to a query - retrieves many rows. I need to program to handle many Rows in VBA. Suggestions much appreciated! Here is an excerpt of my VBA code after the SQLstmt is built: Debug.Print SQLstmt Set RecSet1 = SQLtbl.OpenRecordset(SQLstmt)
3
4027
by: anilcool | last post by:
Hi all, This is probably a simple problem for most of you.. Let me know if you have any pointers for me. I am new to DB2. In my stored procedure I want to select records that match a range of values. =========================================================
0
1978
by: jad2006 | last post by:
i created CREATE PROCEDURE SP_STMT_STMTRETRIEVE10(IN p_client_id varchar(32) ,IN p_TIN varchar(32)) P1: BEGIN DECLARE p_customer_id varchar(32); DECLARE stmt VARCHAR(100); DECLARE cursor1 CURSOR WITH RETURN FOR S1; select customer_id into p_customer_id from .CUSTOMER where client_id = p_client_id; IF (p_TIN is not null ) then
14
6654
by: lewindletter | last post by:
Hi If I do Begin transaction Stmt 1: select count(*) from tableA If the count is zero, then proceed to the following Stmt 2: insert "something" to tableA Stmt 3: insert "something" to tableB
4
1374
seshu
by: seshu | last post by:
Hi everybody Presently Iam write three select statements with diff where and limt conditions but the select stmt in them is same insted of that can i write only one direct stmt and the queries are like this 1)select question,opt1,opt2,opt que_level from questions where que_level=1 limit 4-------here i want only 4 questions whose level is 1 among 100 questions 2)select question,opt1,opt2,opt que_level from questions...
1
7447
by: Kingsly | last post by:
How to read "stmt" column of "sysibm.syspackstmt" table in a readable format? select stmt from sysibm.syspackstmt where name like 'MYPROC1'; I was expecting the stored procedure statements as the output. But executing the above statement yields, x'0700C4001002000000000000000000000000000000000000000000000000000000000000000000250005F1000080D5D3'...
5
6129
by: Mark A | last post by:
"Serge Rielau" <srielau@ca.ibm.comwrote in message news:6i5c4rFoto1gU1@mid.individual.net... When are we getting the execute immediate for "select ... into..." that you mentioned about 3 years ago?
0
7946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8253
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5411
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3867
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1482
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1216
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.