|
i'll have a look at the links as it's pretty late (past midnight) and i'm really tired...
but re: select top 10 *
i reckon this will not work (?) because how i envision it, is the next button is mapped to the 'paging' select... the above code does not guarantee that rows resulting from the first batch will not be in the second batch and so forth... in fact it will result in the same set of rows... unless i create a stored procedure that includes a multiplier along the following code:
select
top (10 * multiplier) *
from
transactionsTable
...then again, i would probably need to put an order by some column at the end of the clause.
----------------------------------------------------------
"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list
|
|
|
|
|
swjam wrote: above code does not guarantee that rows resulting from the first batch will not be in the second batch
Yes, that's why you have to combine it with the ROW_NUMBER() function to get a specific range of rows. The first link covers how to do this.
Or, like Mbah Dhaim suggested, you can use a sub SQL query to keep the already covered pages out of the results.
Obviously, if you are doing any of this, you need to be aware that new data may be being entered into the database, or existing data might be updated or removed between you accessing the pages.
It definitely works, whether it's efficient or not, I don't know. I'd make sure you run some tests, and read up on what would be the best indexes to use.
You might get more expert answers in the SQL server forum now you know what it is to ask about.
Good luck
Simon
|
|
|
|
|
How can you print a datagridview? First, I want to put it in a print document for viewing before I allow to print it. Can anyone give me the full detail of how to do it? Thanks!
|
|
|
|
|
|
Hi,
What's the best way to search a DataTable and retrieve a value??
Any possibility to use an sql Select statement??
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
Thanx
But I still cant use it correctly!
DataRow dr = dt.Select(textboxSalary.toString()+"> MIN_SALARY AND "+texboxSalary.ToString()+ " < MAX_SALARY")[0];
cannot apply operand < to string!!
How can I do it when I need to concatenate integer values as a string for the select statement
Thank you Giorgi!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
Thanx again Giorgi!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
|
if datatable has primary key, you can search using DataTable.Rows.Find(object key) or DataTable.Rows.Find(object[] keys).
if you prefer more like Sql statements, create a DataView instance from your datatable and supply RowFilter property with your criteria ie. 'a like '%filter%' or b=1 and c='2'' etc.
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
i made a combo box ...
now i want that when i click on it for drop down,
it should be displayed all available fontsizes in it.
how can i do it....
Maifs
|
|
|
|
|
|
I just wonder if there is a way of raising a number to a certain power by c# code i.e coding such a function in c#. e.g 3^5,OR 3^x where x can be a variable, now writing this in code form????
|
|
|
|
|
It has to do something with Math doesn't it? Why not search for such class?
|
|
|
|
|
Is it System.Math.Pow() that you are looking for?
Always keep the Murphy Rules in mind!
|
|
|
|
|
I believe it has to do with double power(val, n) etc.
|
|
|
|
|
What are the differences between using :
HttpChannel, TcpChannel, and IpcChannel in .NET Remoting ?
How about the performance ?
Thanks...
|
|
|
|
|
Its all a question of project scope...
HttpChannel
Scope
Wide - Objects can be hosted on an HTTP server, which makes it robust. The object can then be accessed from anywhere on the internet.
Efficiency
Reduced - HTTP brings alot of overhead with it, which reduces efficiency
Security
High - When hosting on IIS, advantage can be taken of SSL(secure socket layer) windows authentication or kerberos.
TCPChannel
Scope
Narrow - This requires certain ports to be opened, and therefor not anyone may obtain access
Efficiency
Increased - the protocol uses raw sockets to transmit data across networks
Security
low - by default there is no security system that companies this protocol, thus creating a security risk.
Hope this helps
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Hey guys... I'm in a bit of a pickle
[backgroundInfo]
The program in question is used to communicate with an external device(fingerprint scanner). Im using the manufacturers SDK to achieve this. What basically happens in the code is a connection is established to the device via serial, lan or *modem. After the connection has been successfully established methods are called for retrieving data etc, etc.
*modem communication is my problem
[/backgroundInfo]
Now the serial and network work perfectly, the modem does not. The method to establish connection via modem is not documented in any way and the more i try and explain to the manufacturers(who cant speak engwish velly goot) to send me code examples of how to establish a modem connection to their hardware using their SDK, the more they send me manuals to create a new dial-up network connection in windows manually
Now the only "workaround" i can think of right now is to create a connection between the two GSM modems via a GSM wrapper that i found here on CP somewhere, and SOMEHOW emulate that connection to a serial port... That way i can just use the SDK's serial connection method which looks like this.
if (ZKclass.Connect_Com(comPort, deviceNumber, baudeRate))
{
}
I'm totally lost, im not even sure if this approach is possible.
Any thoughts and/or ideas are appreciated
Thank you
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Harvey Saayman wrote: Now the serial and network work perfectly, the modem does not.
...
the more they send me manuals to create a new dial-up network connection in windows manually
IMO when you success using LAN, the only thing you must do is establishing connection by modem and use same method with LAN does, but may be using TCP or HTTP or other methods that must be supplied by your manufacturer.
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
how to play a song using MCI ?(C#)
|
|
|
|
|
|
don't know whether this link solves your purpose, please specify which file format you want to play?
and please google first, before posting
http://www.codeproject.com/KB/audio-video/moemeka7.aspx[^]
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
How to create Round(Circle Shape)Button in C#?
|
|
|
|