Click here to Skip to main content
15,885,890 members
Home / Discussions / Database
   

Database

 
AnswerRe: Database Connectivity Problem Pin
Mycroft Holmes13-Aug-15 16:20
professionalMycroft Holmes13-Aug-15 16:20 
AnswerRe: Database Connectivity Problem Pin
Corporal Agarn14-Aug-15 0:40
professionalCorporal Agarn14-Aug-15 0:40 
QuestionUsing SQLite in C++ and C# Pin
Kevin Marois7-Aug-15 12:47
professionalKevin Marois7-Aug-15 12:47 
AnswerRe: Using SQLite in C++ and C# Pin
PIEBALDconsult7-Aug-15 14:04
mvePIEBALDconsult7-Aug-15 14:04 
QuestionSQL Transacation questions Pin
Tunisiano326-Aug-15 1:57
Tunisiano326-Aug-15 1:57 
AnswerRe: SQL Transacation questions Pin
Eddy Vluggen16-Aug-15 1:17
professionalEddy Vluggen16-Aug-15 1:17 
GeneralRe: SQL Transacation questions Pin
chairborne8217-Aug-15 17:12
chairborne8217-Aug-15 17:12 
QuestionSQL Linq, Row Number() Over, equiv in VB Pin
jkirkerx4-Aug-15 14:03
professionaljkirkerx4-Aug-15 14:03 
So I had someone help me write this years ago.

It's a Navigator fly out tab, in which if your working on a product in the editor, you can activate the tab, and the tab will populate with lets say 4 products before and 4 products after the selected product in the database table. This is so you don't have to go back to the index to load the next or previous product.

Since SQL Linq doesn't support the custom SQL Server Function, I need to think or create an alternative way to do this.

I guess I can create a List(Of with a blank column, and then go back and fill in the row numbers
get the row number of the item and ask for -3 and +3 of the row.

Just looking for some suggestions.

Here's the old TSQL
WITH CTE AS
(
 SELECT DISTINCT
  ProductID
, PostageImage
, PartNumber
, ShortDescription
, Price
, Thumbnail
, ActionThumbnail1
, ActionThumbnail2
, ActionThumbnail3
, FlatFee
, FlatFeeName
, VendorName
, ROW_NUMBER() OVER(ORDER BY PartNumber DESC) AS RowId
 FROM PRODUCTINFO p
), CTE1 AS (
 SELECT RowId FROM CTE WHERE PartNumber = @PartNumber
)
 SELECT * FROM CTE WHERE RowId BETWEEN (SELECT RowId-4 FROM CTE1) AND (SELECT RowId+3 FROM CTE1) ORDER BY PartNumber
This is what I was building in Linq Pad. It's pretty weak now, but I'm getting an idea of what I can do. But before I go off in some strange direction that will lead nowhere or be super slow, I thought I would just try and get a general consensus on this.

I tried to mark it as code but it gets chopped off, end of the day for me, going home now.

Dim p_partNumber as string = "06-SM4"
Dim context as new DBcontext

Dim ordersAsList = _
(
From pi in context.ProductInfo
Select pi
).ToList()

Dim orders = _
(
From pi in ordersAsList
take 3
Select
pi.ProductID
)

orders.Dump()
AnswerRe: SQL Linq, Row Number() Over, equiv in VB Pin
Richard Deeming5-Aug-15 1:41
mveRichard Deeming5-Aug-15 1:41 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
jkirkerx5-Aug-15 6:09
professionaljkirkerx5-Aug-15 6:09 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
jkirkerx5-Aug-15 7:58
professionaljkirkerx5-Aug-15 7:58 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
Richard Deeming5-Aug-15 8:12
mveRichard Deeming5-Aug-15 8:12 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
Richard Deeming5-Aug-15 8:18
mveRichard Deeming5-Aug-15 8:18 
GeneralRe: SQL Linq, Row Number() Over, equiv in VB Pin
jkirkerx5-Aug-15 10:39
professionaljkirkerx5-Aug-15 10:39 
QuestionIs this possible, using an old foxpro database files and oledb for DBase Pin
jkirkerx30-Jul-15 13:18
professionaljkirkerx30-Jul-15 13:18 
AnswerRe: Is this possible, using an old foxpro database files and oledb for DBase Pin
Mycroft Holmes30-Jul-15 14:13
professionalMycroft Holmes30-Jul-15 14:13 
GeneralRe: Is this possible, using an old foxpro database files and oledb for DBase Pin
jkirkerx31-Jul-15 6:25
professionaljkirkerx31-Jul-15 6:25 
Questionrestore database Pin
millerwilliam3529-Jul-15 2:51
millerwilliam3529-Jul-15 2:51 
AnswerRe: restore database Pin
CHill6029-Jul-15 3:56
mveCHill6029-Jul-15 3:56 
QuestionRe: restore database Pin
Eddy Vluggen29-Jul-15 5:31
professionalEddy Vluggen29-Jul-15 5:31 
AnswerRe: restore database Pin
Mycroft Holmes29-Jul-15 14:30
professionalMycroft Holmes29-Jul-15 14:30 
AnswerRe: restore database Pin
Nitzan Levi22-Aug-15 20:20
Nitzan Levi22-Aug-15 20:20 
QuestionUpdate SQL Server Table with a Spreadsheet Worksheet DataTable using CommandBuilder Pin
LHendren27-Jul-15 1:37
LHendren27-Jul-15 1:37 
AnswerRe: Update SQL Server Table with a Spreadsheet Worksheet DataTable using CommandBuilder Pin
Mycroft Holmes27-Jul-15 14:33
professionalMycroft Holmes27-Jul-15 14:33 
QuestionSQL Linq, Joins, returns 1st record over and over Pin
jkirkerx23-Jul-15 9:11
professionaljkirkerx23-Jul-15 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.