Click here to Skip to main content
14,775,978 members
Home » Discussions » C#
   

C#

 
QuestionCsharp InTheHand.Net read bluetooth data on received event Pin
nowis773-Nov-20 9:07
Membernowis773-Nov-20 9:07 
AnswerRe: Csharp InTheHand.Net read bluetooth data on received event Pin
jsc423-Nov-20 11:33
professionaljsc423-Nov-20 11:33 
GeneralRe: Csharp InTheHand.Net read bluetooth data on received event Pin
nowis7710-Nov-20 22:01
Membernowis7710-Nov-20 22:01 
QuestionBusiness Layer Question Pin
Kevin Marois2-Nov-20 7:31
professionalKevin Marois2-Nov-20 7:31 
AnswerRe: Business Layer Question Pin
Richard Deeming2-Nov-20 7:45
mveRichard Deeming2-Nov-20 7:45 
GeneralRe: Business Layer Question Pin
Kevin Marois2-Nov-20 8:27
professionalKevin Marois2-Nov-20 8:27 
Questionuse connection from login form in other forms Pin
Newkid on the block31-Oct-20 6:43
MemberNewkid on the block31-Oct-20 6:43 
AnswerRe: use connection from login form in other forms Pin
OriginalGriff31-Oct-20 6:57
mveOriginalGriff31-Oct-20 6:57 
Exactly how depends on the "relationship" between the two forms.
Have a look at these, one of them will fit your circumstances.
The form that creates an instance of another:
MyForm mf = new MyForm();
mf.Show();
Is the "parent", the other form is the "child".
(This doesn't imply any formal MDI relationship)

Transferring information between two forms, Part 1: Parent to Child[^]
Transferring information between two forms, Part 2: Child to Parent[^]
Transferring information between two forms, Part 3: Child to Child[^]

But ... you shouldn't create a SqlConnection and "pass it around" your app - that's a bad idea as some operations such as a DataReader that fails to be closed and disposed properly can "block" the connection object from doing anything else. Instead, create a connection string and pass that around (or create it as a public static property and just use it everywhere). Then create your Connection within a using block each time you need one.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: use connection from login form in other forms Pin
Newkid on the block31-Oct-20 11:21
MemberNewkid on the block31-Oct-20 11:21 
GeneralRe: use connection from login form in other forms Pin
Dave Kreskowiak31-Oct-20 12:26
mveDave Kreskowiak31-Oct-20 12:26 
AnswerRe: use connection from login form in other forms Pin
Dave Kreskowiak31-Oct-20 7:30
mveDave Kreskowiak31-Oct-20 7:30 
AnswerRe: use connection from login form in other forms Pin
BillWoodruff1-Nov-20 16:12
mveBillWoodruff1-Nov-20 16:12 
GeneralRe: use connection from login form in other forms Pin
Newkid on the block3-Nov-20 6:45
MemberNewkid on the block3-Nov-20 6:45 
GeneralRe: use connection from login form in other forms Pin
BillWoodruff3-Nov-20 15:46
mveBillWoodruff3-Nov-20 15:46 
QuestionCrystal reports and datagridviews Pin
Damir Djordjevic31-Oct-20 5:39
MemberDamir Djordjevic31-Oct-20 5:39 
AnswerRe: Crystal reports and datagridviews Pin
Gerry Schmitz31-Oct-20 6:15
mveGerry Schmitz31-Oct-20 6:15 
QuestionIF Else statement on background colour of label. Pin
Member 1497767230-Oct-20 3:29
MemberMember 1497767230-Oct-20 3:29 
SuggestionRe: IF Else statement on background colour of label. Pin
Richard MacCutchan30-Oct-20 3:36
mveRichard MacCutchan30-Oct-20 3:36 
GeneralRe: IF Else statement on background colour of label. Pin
Member 1497767230-Oct-20 3:47
MemberMember 1497767230-Oct-20 3:47 
GeneralRe: IF Else statement on background colour of label. Pin
OriginalGriff30-Oct-20 3:52
mveOriginalGriff30-Oct-20 3:52 
AnswerRe: IF Else statement on background colour of label. Pin
OriginalGriff30-Oct-20 3:50
mveOriginalGriff30-Oct-20 3:50 
GeneralRe: IF Else statement on background colour of label. Pin
Member 1497767230-Oct-20 4:01
MemberMember 1497767230-Oct-20 4:01 
QuestionAdd treasure to my maze game Pin
Member 1497767229-Oct-20 5:10
MemberMember 1497767229-Oct-20 5:10 
AnswerRe: Add treasure to my maze game Pin
OriginalGriff29-Oct-20 5:20
mveOriginalGriff29-Oct-20 5:20 
AnswerRe: Add treasure to my maze game Pin
Gerry Schmitz29-Oct-20 6:14
mveGerry Schmitz29-Oct-20 6:14 

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.