Click here to Skip to main content
15,898,895 members
Home / Discussions / C#
   

C#

 
GeneralRe: DrawString with opacity option not print properly Pin
OriginalGriff29-Nov-19 21:41
mveOriginalGriff29-Nov-19 21:41 
GeneralRe: DrawString with opacity option not print properly Pin
Le@rner29-Nov-19 22:06
Le@rner29-Nov-19 22:06 
GeneralRe: DrawString with opacity option not print properly Pin
OriginalGriff29-Nov-19 22:33
mveOriginalGriff29-Nov-19 22:33 
GeneralRe: DrawString with opacity option not print properly Pin
OriginalGriff29-Nov-19 22:39
mveOriginalGriff29-Nov-19 22:39 
GeneralRe: DrawString with opacity option not print properly Pin
Le@rner29-Nov-19 23:20
Le@rner29-Nov-19 23:20 
GeneralRe: DrawString with opacity option not print properly Pin
OriginalGriff29-Nov-19 23:23
mveOriginalGriff29-Nov-19 23:23 
GeneralRe: DrawString with opacity option not print properly Pin
OriginalGriff29-Nov-19 23:29
mveOriginalGriff29-Nov-19 23:29 
GeneralRe: DrawString with opacity option not print properly Pin
Le@rner29-Nov-19 23:44
Le@rner29-Nov-19 23:44 
GeneralRe: DrawString with opacity option not print properly Pin
OriginalGriff29-Nov-19 23:55
mveOriginalGriff29-Nov-19 23:55 
GeneralRe: DrawString with opacity option not print properly Pin
Le@rner30-Nov-19 0:03
Le@rner30-Nov-19 0:03 
GeneralRe: DrawString with opacity option not print properly Pin
OriginalGriff30-Nov-19 0:11
mveOriginalGriff30-Nov-19 0:11 
QuestionDialogue box disappears when I search in the combo box Pin
Member 1326263928-Nov-19 17:43
Member 1326263928-Nov-19 17:43 
AnswerRe: Dialogue box disappears when I search in the combo box Pin
Dave Kreskowiak28-Nov-19 18:46
mveDave Kreskowiak28-Nov-19 18:46 
Questionhow to check if value exists in database from textbox c# Pin
Member 1464425125-Nov-19 3:10
Member 1464425125-Nov-19 3:10 
AnswerRe: how to check if value exists in database from textbox c# Pin
Pete O'Hanlon25-Nov-19 3:29
mvePete O'Hanlon25-Nov-19 3:29 
GeneralRe: how to check if value exists in database from textbox c# Pin
F-ES Sitecore26-Nov-19 5:11
professionalF-ES Sitecore26-Nov-19 5:11 
GeneralRe: how to check if value exists in database from textbox c# Pin
Pete O'Hanlon26-Nov-19 23:23
mvePete O'Hanlon26-Nov-19 23:23 
AnswerRe: how to check if value exists in database from textbox c# Pin
Richard MacCutchan25-Nov-19 3:39
mveRichard MacCutchan25-Nov-19 3:39 
AnswerRe: how to check if value exists in database from textbox c# Pin
OriginalGriff25-Nov-19 3:52
mveOriginalGriff25-Nov-19 3:52 
AnswerRe: how to check if value exists in database from textbox c# Pin
#realJSOP25-Nov-19 9:23
professional#realJSOP25-Nov-19 9:23 
AnswerRe: how to check if value exists in database from textbox c# Pin
Hailu Worku Obsse26-Nov-19 2:59
professionalHailu Worku Obsse26-Nov-19 2:59 
GeneralRe: how to check if value exists in database from textbox c# Pin
Pete O'Hanlon26-Nov-19 3:28
mvePete O'Hanlon26-Nov-19 3:28 
SuggestionRe: how to check if value exists in database from textbox c# Pin
Eddy Vluggen26-Nov-19 6:15
professionalEddy Vluggen26-Nov-19 6:15 
Pete O'Hanlon wrote:
And what happens if the database is not SQL Server? What if the textbox is an ASP.NET Core one? You are making a lot of assumptions with your answer.
Same can be said from OG's answer, which I still find very valuable.

The assumption for SQL Server is a valid one; if it is another database a similar technique is used and the example given remains valid with minimal change.

I'd argue that it should program against the interface, and use the CreateCommand method from the connection, taking the value of the textbox as an argument.

C#
using (SqlConnection con = new SqlConnection(strConnect))
using (IDbCommand cmd = con.CreateCommand())
{
   cmd.CommandText = "bla"; 
   con.Open(); // as late as possible
And yes, even that would be improved by using the DBProviderFactory, getting the connectionstring and provider from the Settings.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

AnswerRe: how to check if value exists in database from textbox c# Pin
#realJSOP27-Nov-19 0:55
professional#realJSOP27-Nov-19 0:55 
AnswerRe: how to check if value exists in database from textbox c# Pin
Gerry Schmitz27-Nov-19 7:15
mveGerry Schmitz27-Nov-19 7:15 

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.