get number from row

if i have a this string to select a row from database of acess:

select TOP 1 * from odkazy
how i elicit from it id column? i need know id from select row
0
Coolplayer
2/9/2004 6:47:28 PM
asp.net.access-datasource 4679 articles. 0 followers. Follow

10 Replies
518 Views

Similar Articles

[PageSpeed] 40

then just get the id...

select top 1 id from odkazy...
PS..you would need an order by clause in the select statement otherwise the TOP has no meaning..

hth
***********************
Dinakar Nethi
Life is short. Enjoy it.
***********************
0
ndinakar
2/9/2004 9:51:01 PM
my problem: (for example)

if i have 5 columns with numbers in select row
and i want display cast of this numbers I write:
one = ds.tables("Odkazy").Rows(i)("one")
two..
three..
(...)
cast = one + two... and so on

important- i is id number(number of select row) and i want know it
i try
i = ds.dataitem("id") 'while ds is dataset but this is wrong (i declared everything(here not for short))
if you dont understant my problem, please write
0
Coolplayer
2/11/2004 5:40:57 PM
sorry i dont think i understand you...do you intend to  concatenate the values of all the rows selected ? can you give a more clearer xample..?
***********************
Dinakar Nethi
Life is short. Enjoy it.
***********************
0
ndinakar
2/12/2004 2:13:43 AM
i rather ask

i have a table in acess database and i want display cast several number in columns in
row which i dont know (row will be select by user)
and i want display this result, thats all
if i select:
select * from tblsomething where PP = OO
where PP and OO is properties
i want display result of cast
a column
and b column
and so on
can you help?
0
Coolplayer
2/12/2004 8:10:42 PM

Dim Conn As New System.Data.SqlClient.SqlConnection("server=local;database=test;Integrated Security=SSPI")
Dim Comm1 As New SqlClient.SqlCommand("select col1,col2,col3 from table...",Conn)
Conn.Open()
Dim oDataTrans As SqlClient.SqlDataReader = Comm1.ExecuteReader(CommandBehavior.CloseConnection)
While oDataTrans.Read()
col1val=oDataTrans.GetSqlValue(0).ToString()
col2val=oDataTrans.GetSqlValue(1).ToString()
col3val=oDataTrans.GetSqlValue(2).ToString()
End While
oConn.Close()

and you can use the values of col1val, col2val and col3val and concatenate them....
hth

***********************
Dinakar Nethi
Life is short. Enjoy it.
***********************
0
ndinakar
2/12/2004 9:38:20 PM
you understand me,

but
I RECEIVE AN ERROR:
BC30311: Value of type 'System.Data.OleDb.OleDbConnection' cannot be converted to
'System.Data.SqlClient.SqlConnection'.
what i can do?
0
Coolplayer
2/13/2004 5:51:08 PM
oops sorry you need to change all the sqlconnections to oledb connections...the code i gave you was for SQL server...

if you are having prb making the change let me know..

***********************
Dinakar Nethi
Life is short. Enjoy it.
***********************
0
ndinakar
2/13/2004 7:23:50 PM
i try it, but i am novice and i dont know how change all, only how change first line(connection to database)

can you write it retry?
and sorry about my english!
0
Coolplayer
2/14/2004 4:33:33 PM

Dim Conn As New System.Data.SqlClient.SqlConnection("server=local;database=test;Integrated Security=SSPI")
Dim Comm1 As New OleDb.OleDbCommand("select col1,col2,col3 from table...",Conn)
Conn.Open()
Dim oDataTrans As OleDb.OleDbDataReader = Comm1.ExecuteReader(CommandBehavior.CloseConnection)
While oDataTrans.Read()
col1val=oDataTrans.GetSqlValue(0).ToString()
col2val=oDataTrans.GetSqlValue(1).ToString()
col3val=oDataTrans.GetSqlValue(2).ToString()
End While
oConn.Close()

Starting with ASP.NET 2.0? Look at:
Programming Microsoft Web Forms
My Blog
0
douglas
2/14/2004 4:36:01 PM
i think the connection string needs to be 


"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\somepath\mydb.mdb;User Id=admin;Password=;"

hth
***********************
Dinakar Nethi
Life is short. Enjoy it.
***********************
0
ndinakar
2/15/2004 3:49:42 AM
Reply:

Similar Artilces:

How to set the row number and get the row number for ("selected row) in Datagrid
I face a problem that i can't get the selected row of the datagrid in both server side script (VB.net) and client side script (javascript) As i can't use the button column / hyperlink column in the datagrid. Thus , i need to handle the change the background color of the selected row and also to get the selected row number for Update/Delete. Thanks in advance. This depends on how do you perform the selection. Do you want to implement chaning of the SelectedRow at the client side without any postback? If you have no issues with postback, then you can do s little trick here: 1. ...

Get access to an alternating Grid row number
Hi,   How can one get access to the index of the row being generated in a GridView server control? I know how to do it form the code-behind, when an event occurs such as deleteig the row, for example:   protected void grid_RowDeleting(object sender, GridViewDeleteEventArgs e) { // Index of the row being deleted int rowIndex = e.RowIndex;     but I would like to know if there is a possibility to get know the row number from the .aspx code, while the page is being built.   The background color of the rows is alternating, so I would like to put a different...

Get the Row Number or Row ID
Hi, I am using Sybase Central v4.3 with Interactive SQL to query the SQL Commands. My concern is how to get the rownumber or row id in select queries. Is there any in built commands in the ASE. If not please suggest me how to get the rownumber. Thanks.... Unless i'm mistaken, ASE does not use a rowid... it can have a timestamp, but it is updated with every modification to the row. http://infocenter.sybase.com/help/topic/com.sybase.help.ase_15.0.blocks/html/blocks/blocks34.htm -- Cory Sane [TeamSybase] Certified Sybase Associate DBA for ASE 15.0 "Santhanam P" wrote...

The row number and offset of each row in the page should have a matching entry in row number table
Is the proper correction for the following to recreate the table BCPout/IN or table to table insert, or just drop and recreate the index? Row number is 0. Is there a way to correct just the data page? Table Corrupt: The row number and offset of each row in the page should have a matching entry in row number table; check this page (page#=772121 row#=0 offset in row number table=0) Table Corrupt: The row number and offset of each row in the page should have a matching entry in row number table; check this page (page#=772121 row#=0 offset in row number table=0) Table Corrupt: The row...

getting the number of rows...
how can you get the number of rows in query resault with out filling dataset and checking the "count"? afaik - you can't - - you've got to have an entity to count the rows - the dataset is the 'finished product' that contains the result of your query - until you've queried and received the data from the database, you don't know how many rows you've receivedDavid WierMCP/ASPInsiderASPNet101.com - where to look first!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(Please 'Mark as ...

How do I get the row number?
I have tryed to find a way to include the row number in a querry but without result. I have a table select some rows ordered and now I will add a column called rank How do I get the rownumber in the field rank ? Thanks in advance Jan O Jan O www.olsmar.com The way I'd suggest assigning a row number to your resultset is to INSERT your resultset into a temporary table or table variable which has an IDENTITY column, something like this: -- set up a table variable to hold the resultset DECLARE @myTable (Rank int identity(1,1) primary_key, ColumnA va...

How do you get the number of rows
I have a gridview and I want to display the total number of rows of data like 5000 rows? This is not the same as the GridView1.Rows.Count, which gives the number of rows being displayed like 10 of 5000 rows. How do I get at the total? Hi, i think what you are asking is how to get the number of rows of the bounded dataset. Lets say you bound a dataset to the grid, you only need to get the number of rows of the first table in the dataset: myDataset.tables(0).rows.count As simple as that!   regards, njs That works in ASP.NET 1.x That doesn't work in ASP.NET 2.0...

How can I count number of rows in each datawindow in composit datawindow then access and set item in each row in each datawindow!
Hi friends, I created a composite datawindow includes three datawindow. How can I count the number of rows in each datawindow? (Rowcount() function can not works). Also, I need access in each row then reset the value that I want in each row in each datawindow. I use the property to access to get data in each row in each datawindow, but the right value only happens in the first row of each datawindow. It seems I used the loop access the value it doesn't work. Indeed, It has the all data for me but just right for the first row in each data window. Could you have any ideas, please!...

How can I count number of rows in each datawindow in composit datawindow then access and set item in each row in each datawindow!
This is a multi-part message in MIME format. ------=_NextPart_000_004F_01C308EA.58A195E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi friends, I created a composite datawindow includes three datawindow. How can I count the number of rows in each datawindow? (Rowcount() function can = not works). Also, I need access in each row then reset the value that I want = in each row in each datawindow. I use the property to access to get data in each row in each datawindow, but the right value only happens in the = fi...

How can I count number of rows in each datawindow in composit datawindow then access and set item in each row in each datawindow! #2
This is a multi-part message in MIME format. ------=_NextPart_000_0043_01C308EA.0E4861E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi friends, I created a composite datawindow includes three datawindow. How can I count the number of rows in each datawindow? (Rowcount() function can = not works). Also, I need access in each row then reset the value that I want = in each row in each datawindow. I use the property to access to get data in each row in each datawindow, but the right value only happens in the = fi...

Can not get Pickup Directory... .net can't access metabase maybe??? Need to get working ASAP
I am using 2.0 to try to send an email to the IisPickup directorySystem.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(test@testing.com, "test@test.com", "Testing " + DateTime.Now.ToString(), "Testing the Mail Drop Folder");System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("127.0.0.1");client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.PickupDirectoryFromIis; client.Send(message);Example Site : www.andrewworral.com (hit the button)This code worked on our old deployment server but not on our new server.  I s...

accessing row by row
first of all sorry if i posted this in a wrong place but i'm new to powerbuilder and i have to develop a program quite quickly ( i only worked with acces until now) i have been provided a excel spreadsheet that contains all coloms and rows from all tables wich i have to insert in a database. The difficulty is that i can't use a datapipeline because i need to use a string function to check in wich table i have to put it: TABLENAME_COLUMNNAME -> i thought about using the string function to find out the right column in the right database. however i don't know how you ...

Getting row number from SelectedIndexChanged??
Hello, now, I have 2 template columns, the first is a hyperlink column that consist of userno, the next is the gender which is represented by a radiobuttonlist. The radiobuttonlist fire up a method when somebody clicks on or change the selected one: Protected Sub SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim objItem As DataGridItem Response.Write(CType(DataGrid1.Items.Item(DataGrid1.SelectedIndex).FindControl("hl_oNo"), HyperLink)) End Sub I need to read the userno from the hyperlink column so that the...

Getting data from an Access datasource
I'm not sure this is right, but I think it is. Given:  Dim myData As New AccessDataSource myData.DataFile = "~/App_Data/Library.MDB" mydata.SelectCommand = "SELECT * FROM users WHERE username = ? AND password = ?" mydata.SelectParameters.Add("username", txtUsername.Text.Trim) mydata.SelectParameters.Add("password", txtPassword.Text.Trim) myData.DataBind() How do you determine if the select produced any rows and how do you test the values in the returned row? With OLEDB I used a datareader but I can't seem to figure out how to do it ...

Web resources about - get number from row - asp.net.access-datasource

Number - Wikipedia, the free encyclopedia
A number is a mathematical object used to count , label, and measure . In mathematics , the definition of number has been extended over the years ...

Number - Wikipedia, the free encyclopedia
A number is a mathematical object used to count , label, and measure . In mathematics , the definition of number has been extended over the years ...

Has Telstra dialled a wrong number with its global roaming price hike?
Will Telstra make more money out of its price hike than it will lose from fleeing customers?

Facebook’s Live Video feature expands to a small number of non-famous users
... famous to broadcast live video from Facebook . The social networking giant announced today that it was expanding the feature to a small number ...

Ballmer: Microsoft’s cloud revenue numbers are “bullshit”
Microsoft today held its annual shareholder meeting, leaving one significant Microsoft shareholder—former CEO Steve Ballmer—less than happy with ...

‘Significant Number Of New Carriers’ Good For Apple: Wells Fargo
Apple ( AAPL ) added 26 new carriers as of the end of last month, bringing its total to a new high of 433, and that’s good news for the stock, ...

Even Hollywood insiders are completely clueless about Netflix's streaming numbers
... fees from cable companies, both of which depend on ratings. And Netflix has decided that, at least for now, it's better off keeping those numbers ...

San Bernardino attack, by the numbers
Wednesday's shooting in San Bernardino is one of the deadliest in U.S. history. These are the numbers linked to the attack.

This one number explains Donald Trump's support (+video)
The number symbolizes the surprising nature of Donald Trump's rise to front-runner status.

355?! Why This Number Is Meaningless When It Comes To Mass Shootings
355?! Why This Number Is Meaningless When It Comes To Mass Shootings

Resources last updated: 12/4/2015 5:08:12 AM