Click here to Skip to main content
15,899,937 members
Home / Discussions / Database
   

Database

 
GeneralRe: Alphabetical sorting - SQL Pin
pbpb14-Sep-04 23:46
pbpb14-Sep-04 23:46 
GeneralRe: Alphabetical sorting - SQL Pin
butchzn27-Sep-04 1:44
butchzn27-Sep-04 1:44 
Questioncopy db diagrams from one sql server to another? Pin
Roger Alsing14-Sep-04 21:42
Roger Alsing14-Sep-04 21:42 
AnswerRe: copy db diagrams from one sql server to another? Pin
Totoo15-Sep-04 9:50
Totoo15-Sep-04 9:50 
GeneralVarbinary field comparisons Pin
cpritt14-Sep-04 8:29
cpritt14-Sep-04 8:29 
GeneralRe: Varbinary field comparisons Pin
Jon Rista14-Sep-04 8:44
Jon Rista14-Sep-04 8:44 
GeneralRe: Varbinary field comparisons Pin
cpritt14-Sep-04 9:52
cpritt14-Sep-04 9:52 
GeneralRe: Varbinary field comparisons Pin
Jon Rista14-Sep-04 13:17
Jon Rista14-Sep-04 13:17 
"SELECT " + whatever + " WHERE sid=0x" + a.GetString(1);

When you build a query to execute with a SqlCommand, its just a string. Don't call GetSqlBinary, because its going to return the native type for binary data: byte[]. Call GetString....the SqlDataReader should properly convert from the native Sql datatype to a string, and then you just append that string to the rest of the query.

you'll end up with a SELECT statement thats something like:

"SELECT col1, col2, col3 FROM table WHERE sid=0x27FA32BE455789"

If that select statement executes fine if you run it directly on the database, it should run fine through a SqlCommand. Its just a matter of retrieving the data from the resultset in the way you want it. Just because something is an int in the resultset doesn't mean you have to call GetInt().
GeneralRe: Varbinary field comparisons Pin
cpritt14-Sep-04 18:57
cpritt14-Sep-04 18:57 
GeneralRe: Varbinary field comparisons Pin
Jon Rista15-Sep-04 7:16
Jon Rista15-Sep-04 7:16 
GeneralRe: Varbinary field comparisons Pin
cpritt15-Sep-04 8:54
cpritt15-Sep-04 8:54 
GeneralRe: Varbinary field comparisons Pin
Jon Rista30-Sep-04 18:52
Jon Rista30-Sep-04 18:52 
GeneralExtreme performance issues (SQL Server 2000/ADO.NET/C#) Pin
Jon Rista14-Sep-04 8:14
Jon Rista14-Sep-04 8:14 
GeneralRe: Extreme performance issues (SQL Server 2000/ADO.NET/C#) Pin
Steven Campbell14-Sep-04 9:34
Steven Campbell14-Sep-04 9:34 
GeneralRe: Extreme performance issues (SQL Server 2000/ADO.NET/C#) Pin
Steven Campbell14-Sep-04 9:35
Steven Campbell14-Sep-04 9:35 
GeneralRe: Extreme performance issues (SQL Server 2000/ADO.NET/C#) Pin
Jon Rista14-Sep-04 13:13
Jon Rista14-Sep-04 13:13 
GeneralRe: Extreme performance issues (SQL Server 2000/ADO.NET/C#) Pin
Steven Campbell14-Sep-04 14:08
Steven Campbell14-Sep-04 14:08 
GeneralRe: Extreme performance issues (SQL Server 2000/ADO.NET/C#) Pin
Jon Rista14-Sep-04 14:26
Jon Rista14-Sep-04 14:26 
GeneralWorking with a database Pin
Britnt714-Sep-04 2:17
Britnt714-Sep-04 2:17 
QuestionHow to display message when record is not found? Pin
DotNet13-Sep-04 23:00
DotNet13-Sep-04 23:00 
AnswerRe: How to display message when record is not found? Pin
Colin Angus Mackay14-Sep-04 2:52
Colin Angus Mackay14-Sep-04 2:52 
GeneralRe: How to display message when record is not found? Pin
DotNet14-Sep-04 2:59
DotNet14-Sep-04 2:59 
GeneralRe: How to display message when record is not found? Pin
Steven Campbell14-Sep-04 4:35
Steven Campbell14-Sep-04 4:35 
GeneralRe: How to display message when record is not found? Pin
DotNet14-Sep-04 4:56
DotNet14-Sep-04 4:56 
GeneralSQL Server/Access Import Issue Pin
Ossmer13-Sep-04 21:45
Ossmer13-Sep-04 21:45 

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.