G
Guest
Hi Friends,
I have created a tableadapter (using wizard of VS2005) with some SQL query
statement. But I want to write SQL query such a way that it returns table
with one more fields, i.e. Row number.
I have tried this SQL query in SQL server 2005:
select ordernumber, row_number() over( order by ordernumber) sno from
orderhead
It's working in SQL server 2005 but not in table adapter (It gives SQL
syntax error in 'Add Query' wizard).
Please help me to add such a column in SQL.
And why should tableadapter give any error? This query is working with
dataadapter!! I mean, this code is working
Dim ds As New DataSet
Dim da As New SqlClient.SqlDataAdapter("select ordernumber,
row_number() over( order by ordernumber) sno from orderhead" _
, conStr)
da.Fill(ds, "TAB1")
Thanks in Advanced,
-Yogee
I have created a tableadapter (using wizard of VS2005) with some SQL query
statement. But I want to write SQL query such a way that it returns table
with one more fields, i.e. Row number.
I have tried this SQL query in SQL server 2005:
select ordernumber, row_number() over( order by ordernumber) sno from
orderhead
It's working in SQL server 2005 but not in table adapter (It gives SQL
syntax error in 'Add Query' wizard).
Please help me to add such a column in SQL.
And why should tableadapter give any error? This query is working with
dataadapter!! I mean, this code is working
Dim ds As New DataSet
Dim da As New SqlClient.SqlDataAdapter("select ordernumber,
row_number() over( order by ordernumber) sno from orderhead" _
, conStr)
da.Fill(ds, "TAB1")
Thanks in Advanced,
-Yogee