Click here to Skip to main content
15,896,154 members
Home / Discussions / Database
   

Database

 
GeneralRe: ADO.NET almost nullable column Pin
Mycroft Holmes25-Apr-10 22:26
professionalMycroft Holmes25-Apr-10 22:26 
QuestionCLR stored procedure cross base access Pin
Yoyosch23-Apr-10 4:12
Yoyosch23-Apr-10 4:12 
AnswerRe: CLR stored procedure cross base access Pin
Mycroft Holmes24-Apr-10 13:27
professionalMycroft Holmes24-Apr-10 13:27 
QuestionSunday first last in week? Pin
Stanciu Vlad23-Apr-10 0:04
Stanciu Vlad23-Apr-10 0:04 
AnswerRe: Sunday first last in week? Pin
Stanciu Vlad23-Apr-10 0:15
Stanciu Vlad23-Apr-10 0:15 
QuestionSELECT last date from database column entries ! Pin
jeshra27922-Apr-10 23:56
jeshra27922-Apr-10 23:56 
AnswerRe: SELECT last date from database column entries ! Pin
O.Phil23-Apr-10 0:13
O.Phil23-Apr-10 0:13 
AnswerRe: SELECT last date from database column entries ! Pin
Luc Pattyn23-Apr-10 0:14
sitebuilderLuc Pattyn23-Apr-10 0:14 
Hi,

try
"SELECT MAX([Closing Date]) FROM client_details WHERE [Closing Date] <= '"+textbox.text+"'"


(assuming C# is what you need). With some comments:

1. it is much easier when database field names don't contain special characters and spaces.

2. such SQL statement is vulnerable to SQL injection: users could enter parts of an SQL command, which your code then executes. Solution: verify the textbox content, or better yet, use SQLparameter.

3. the user must enter a string representing a date, according to the format your database is expecting. It is better to have the user enter data according to the system's regional settings, then to convert it to what the database needs. Again SQLParameter is the better approach: use DateTime.Parse(textbox.text) (or TryParse), then set the SQLParameter.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Prolific encyclopedia fixture proof-reader browser patron addict?
We all depend on the beast below.


AnswerRe: SELECT last date from database column entries ! Pin
Mycroft Holmes24-Apr-10 13:34
professionalMycroft Holmes24-Apr-10 13:34 
QuestionSQL Server 2008: Will the stored procedure be rolled back if the db server gets an error (server crash or performance problem) in the middle of it's operation? Pin
Rafferty Uy22-Apr-10 18:38
Rafferty Uy22-Apr-10 18:38 
AnswerRe: SQL Server 2008: Will the stored procedure be rolled back if the db server gets an error (server crash or performance problem) in the middle of it's operation? Pin
PIEBALDconsult22-Apr-10 18:47
mvePIEBALDconsult22-Apr-10 18:47 
GeneralRe: SQL Server 2008: Will the stored procedure be rolled back if the db server gets an error (server crash or performance problem) in the middle of it's operation? Pin
Rafferty Uy22-Apr-10 18:55
Rafferty Uy22-Apr-10 18:55 
AnswerRe: SQL Server 2008: Will the stored procedure be rolled back if the db server gets an error (server crash or performance problem) in the middle of it's operation? Pin
Eddy Vluggen22-Apr-10 22:25
professionalEddy Vluggen22-Apr-10 22:25 
GeneralRe: SQL Server 2008: Will the stored procedure be rolled back if the db server gets an error (server crash or performance problem) in the middle of it's operation? Pin
Rafferty Uy23-Apr-10 0:22
Rafferty Uy23-Apr-10 0:22 
GeneralRe: SQL Server 2008: Will the stored procedure be rolled back if the db server gets an error (server crash or performance problem) in the middle of it's operation? Pin
Eddy Vluggen23-Apr-10 0:39
professionalEddy Vluggen23-Apr-10 0:39 
GeneralRe: SQL Server 2008: Will the stored procedure be rolled back if the db server gets an error (server crash or performance problem) in the middle of it's operation? Pin
Rafferty Uy23-Apr-10 4:49
Rafferty Uy23-Apr-10 4:49 
QuestionSSIS failed with error 43% in Windows scheduler but no problem manually running the batch file... Pin
nataliedw22-Apr-10 14:44
nataliedw22-Apr-10 14:44 
NewsNew SQL Azure features now available Pin
GoAzure22-Apr-10 9:29
GoAzure22-Apr-10 9:29 
NewsNew OData Service for SQL Azure Uses AppFabric Pin
GoAzure22-Apr-10 9:19
GoAzure22-Apr-10 9:19 
Question"Connecting to sql server files" error Pin
#realJSOP21-Apr-10 5:17
professional#realJSOP21-Apr-10 5:17 
AnswerRe: "Connecting to sql server files" error Pin
Tim Carmichael21-Apr-10 5:44
Tim Carmichael21-Apr-10 5:44 
AnswerRe: "Connecting to sql server files" error Pin
Luc Pattyn21-Apr-10 6:08
sitebuilderLuc Pattyn21-Apr-10 6:08 
GeneralRe: "Connecting to sql server files" error Pin
#realJSOP21-Apr-10 7:02
professional#realJSOP21-Apr-10 7:02 
AnswerRe: "Connecting to sql server files" error Pin
dan!sh 22-Apr-10 5:03
professional dan!sh 22-Apr-10 5:03 
GeneralRe: "Connecting to sql server files" error Pin
Luc Pattyn22-Apr-10 5:30
sitebuilderLuc Pattyn22-Apr-10 5:30 

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.