Click here to Skip to main content
15,902,112 members
Home / Discussions / Database
   

Database

 
GeneralRe: comboBox1.ValueMember = "column1" Pin
myNameIsRon20-Feb-06 12:50
myNameIsRon20-Feb-06 12:50 
AnswerRe: comboBox1.ValueMember = "column1" Pin
AlexeiXX320-Feb-06 7:18
AlexeiXX320-Feb-06 7:18 
GeneralRe: comboBox1.ValueMember = "column1" Pin
myNameIsRon20-Feb-06 12:45
myNameIsRon20-Feb-06 12:45 
GeneralRe: comboBox1.ValueMember = "column1" Pin
AlexeiXX320-Feb-06 13:41
AlexeiXX320-Feb-06 13:41 
QuestionDate problem Pin
sebastian yeok18-Feb-06 22:41
sebastian yeok18-Feb-06 22:41 
AnswerRe: Date problem Pin
Colin Angus Mackay19-Feb-06 0:41
Colin Angus Mackay19-Feb-06 0:41 
GeneralRe: Date problem Pin
sebastian yeok19-Feb-06 1:53
sebastian yeok19-Feb-06 1:53 
GeneralRe: Date problem Pin
Colin Angus Mackay19-Feb-06 2:19
Colin Angus Mackay19-Feb-06 2:19 
sebastian yeok wrote:
1) How to display the "author" using the lblShow.


If you are referring to how the layering pattern works then you put all your data access in one class (or a group of classes dedicated to data access) and call a method on the class. This removes the data access code from the user interface class. If you design it correctly it also means that at some point in the future you can swap out the data access classes and implement a new set of classes (that have the same public interface) that access a different database.


sebastian yeok wrote:
in this, it retrive one record, how about retrive more records?


Go back to using the data reader. From the code you originally supplied you were only ever reading one column and one row from the database - so it would appear to be a good candidate for using ExecuteScalar()

sebastian yeok wrote:
let say 10 records, how to display it?


I don't know enough about your intended user interface to answer that.

sebastian yeok wrote:
how about retrive data between 2005/5/15 and 2006/5/15


Change you SQL to handle a date range. For example:
SELECT Columns 
FROM MyTable 
WHERE DateColumn >= @startDate
AND DateColumn <= @endDate

And pass in the parameters for @startDate and @endDate. Remember that a DateTime object for a date only sets the time to midnight. So, for the end date, you might want to set the time element as well to 23:59 to ensure you get results that occur on the end date.

ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

GeneralRe: Date problem Pin
sebastian yeok19-Feb-06 2:37
sebastian yeok19-Feb-06 2:37 
GeneralRe: Date problem Pin
Colin Angus Mackay19-Feb-06 2:43
Colin Angus Mackay19-Feb-06 2:43 
QuestionHow to indent SQL statements? Pin
sacoskun18-Feb-06 21:19
sacoskun18-Feb-06 21:19 
AnswerRe: How to indent SQL statements? Pin
Colin Angus Mackay19-Feb-06 0:26
Colin Angus Mackay19-Feb-06 0:26 
GeneralRe: How to indent SQL statements? Pin
CWIZO19-Feb-06 1:40
CWIZO19-Feb-06 1:40 
GeneralRe: How to indent SQL statements? Pin
Paul Conrad19-Feb-06 7:45
professionalPaul Conrad19-Feb-06 7:45 
GeneralRe: How to indent SQL statements? Pin
sacoskun20-Feb-06 9:10
sacoskun20-Feb-06 9:10 
Questionmove table record Pin
sebastian yeok18-Feb-06 21:02
sebastian yeok18-Feb-06 21:02 
AnswerRe: move table record Pin
Colin Angus Mackay19-Feb-06 2:47
Colin Angus Mackay19-Feb-06 2:47 
QuestionDifference between two tables Pin
niceguyeddie199917-Feb-06 5:11
niceguyeddie199917-Feb-06 5:11 
AnswerRe: Difference between two tables Pin
Colin Angus Mackay17-Feb-06 5:35
Colin Angus Mackay17-Feb-06 5:35 
GeneralRe: Difference between two tables Pin
niceguyeddie199917-Feb-06 5:38
niceguyeddie199917-Feb-06 5:38 
GeneralRe: Difference between two tables Pin
Colin Angus Mackay17-Feb-06 8:46
Colin Angus Mackay17-Feb-06 8:46 
QuestionUrgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
devvvy16-Feb-06 17:45
devvvy16-Feb-06 17:45 
AnswerRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
Edbert P19-Feb-06 13:16
Edbert P19-Feb-06 13:16 
GeneralRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
devvvy19-Feb-06 14:45
devvvy19-Feb-06 14:45 
GeneralRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
Edbert P19-Feb-06 17:03
Edbert P19-Feb-06 17:03 

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.