dcsimg

Search:

Type: Posts; User: VAian

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    514

    Re: How to load datatable into database?

    My questions are actually the comments inside the code, everywhere.
  2. Replies
    1
    Views
    514

    How to load datatable into database?

    As newbie, I have really spent a lot of time searching on the web, but have not solved my issue. Online information is kinda general, I could not find anything very similar to my case.

    I really...
  3. Re: How can I write this kind of SELECT .... AS statement?

    Yes, Display, that is typo, but it is irrelevant, just making up an example.

    Sybase

    Thanks.
  4. How can I write this kind of SELECT .... AS statement?

    Just an example, basically, there is a table Customers, which has multiple fields (including FName and LName, and other fields too).

    Basically, I want to have two fields of information going to...
  5. Re: How to automatically open a child form when running an Mdi application?

    Now I get your point, and below code resolves the issue.



    private void MainForm_Load(object sender, EventArgs e)
    {
    FormLogin fLogin = new FormLogin();
    ...
  6. Re: How to automatically open a child form when running an Mdi application?

    You don't get my question, you only quote first part of my sentence(that is misleading), while the second part of my sentence is my point. What I was saying: it seems to me in order to create handle...
  7. Re: How to automatically open a child form when running an Mdi application?

    I don't understand how to create event handler, while the action of opening FormLogin is not associated with any buttons/labels.
  8. Re: How to automatically open a child form when running an Mdi application?

    Since I am new to Visual Studio, I cannot fully understand your post. In my case, is MainForm the parent form? MainForm sets ismdicontainer=True

    Then I create FormLogin as one of child forms.

    I...
  9. [RESOLVED] How to automatically open a child form when running an Mdi application?

    Application.Run(new MainForm());

    I would like to open child form FormLogin when running the application, how to do that? Currently, MainForm is maximized, how to also maximize FormLogin inside...
  10. Replies
    1
    Views
    285

    How to center align winforms heading text?

    For example, default main form is called Form1, while the text "Form1" always left aligned on my computer, how can I move it to the center? I did not find it in form property.

    Thanks.
  11. Re: How to write C# code to upload excel data to database table?

    Okay, thanks. I will do more research when I have spare time. Learning little by little, from database connection, to switching forms, then next thing will be: use an OleDbDataAdapter to read data...
  12. Re: How to write C# code to upload excel data to database table?

    Thank you for explanation. Let us try to throw out more questions based on your answers:

    when insert fails, it will throw an exception: so I should use: try catch ?
    How to validate? Is there a...
  13. Re: How to write C# code to upload excel data to database table?

    Thank you, now I have some basic ideas what to learn. I will break it down to some smaller parts, and try to do some research and figure out each part.

    Before doing anything, may I ask a few...
  14. Re: Is there some kind of C# code for Screenupdate =True/False?

    I am new to Visual Studio, thanks for bring up the keyword MDI, so that I know where I should begin with. I am not looking for some specific code right now, just want to know how to do it in concept....
  15. [RESOLVED] How to write C# code to upload excel data to database table?

    Trying to explain the case as clearly as I can.

    Let us say, I have database connection string code (see below), which works fine.

    Let us say, the database is xyz, and there is table called...
  16. Re: Is there some kind of C# code for Screenupdate =True/False?

    Thanks, could you please explain more about how to do "using a MDI type application" in Visual Studio? I mean where to begin with, I completely don't understand the concept.

    Edit: Never mind, I...
  17. [RESOLVED] Is there some kind of C# code for Screenupdate =True/False?

    Newbie, I am trying to explain my thread clearly, last month, I posted a thread about switching window form, now asssuming the issue is resolved, so this thread is not about switching window form.
    ...
  18. Replies
    14
    Views
    945

    Re: How to STOP program when catch an error?

    Thanks for your suggestion, I think your code will act same as below code. It is Form Login, so when there is issue to log in, the program needs to stop, there is nothing else to be executed. if...
  19. Flutter (dart) vs. Visual Studio (C# Xamarin)

    As a newbie, which platform and which language should I learn?

    Where is near term future and long term future?

    I am learning to building mobile apps, for publishing on Google Play store and...
  20. Replies
    1
    Views
    374

    Use C# Code to load excel data to database?

    I don't have the code yet, let me ask about code structure first.

    Let us say, I have ODBC database connection string (as below), now I want to accomplish below two tasks:

    1) View a database...
  21. Replies
    14
    Views
    945

    Re: How to STOP program when catch an error?

    I understand the new form will not show here, so I used comment to omit that part of code, since I have not figured out how to write code to switch form, that is a different topic in another thread:...
  22. Replies
    14
    Views
    945

    Re: How to STOP program when catch an error?

    I am new, sorry that I could not use accurate term to clearly explain my question.

    In VBA, take the above code for example, the logic(what I want) will be something like below, I want something...
  23. Replies
    14
    Views
    945

    Re: How to STOP program when catch an error?

    No No No, re-enter username/password, then click button Connect, then re-run the whole application from the beginning, it is still going through one set of username/password only, nothing to do with...
  24. Replies
    14
    Views
    945

    Re: How to STOP program when catch an error?

    To my understanding, loop is more about recurrence, it is like going through many sets of username/password. For my case, it only goes through one set of username/password, if you tell me to use IF...
  25. Replies
    14
    Views
    945

    Re: How to STOP program when catch an error?

    Technically, this is what I would like to accomplish:
    1) If username/password is correct, then switch to another form FormInterface;
    2) If username/password is wrong, stay in current form...
  26. Replies
    14
    Views
    945

    How to STOP program when catch an error?

    OdbcConnection Cn;
    Username = txtUsername.Text;
    Password = txtPassword.Text;
    ConnectionString = "Driver={Adaptive Server Enterprise};server=*****;port=*****;db=*****;uid=" + Username + ";pwd=" +...
  27. Replies
    3
    Views
    476

    Re: C# Try/Catch/Finally = VBA On Error GoTo

    finally is optional? In what case do we need to use finally ?

    Thanks.
  28. Replies
    24
    Views
    1,228

    Re: Switching between window forms?

    Thanks, but it is too difficult for me(newbie) to understand the thread, I don't know what it means.

    Basically, I just need to add TrayApplicationContext.cs to my project? Then change Program.cs...
  29. Replies
    24
    Views
    1,228

    Re: Switching between window forms?

    Thanks, but that thread is too complicated for me (newbie) to understand.
  30. Replies
    24
    Views
    1,228

    Re: Switching between window forms?

    https://www.homeandlearn.co.uk/csharp/csharp.html
    http://jmcilhinney.blogspot.com/2012/04/managing-data-among-multiple-forms-part.html

    Where is your thread on a Formless Tray Application?
    ...
  31. Replies
    3
    Views
    476

    C# Try/Catch/Finally = VBA On Error GoTo

    string ConnectionString;
    SqlConnection Cn;
    Username = txtUsername.Text;
    Password = txtPassword.Text;
    ConnectionString = "Driver={Adaptive Server...
  32. Re: Connection String Variable Declare Error(Type or namespace name could not be foun

    Let me ask in another way: Can Sybase database (Adaptive Server Enterprise) be considered as SQL Server database? If not, what should I use to substitute SqlConnection ?

    Thanks.
  33. Re: Connection String Variable Declare Error(Type or namespace name could not be foun

    ODBC has already set up in work computer, and connect string inside post#1 code is correct. My question is about related to the term SqlConnection , I don't know what it means here.

    Another...
  34. Replies
    24
    Views
    1,228

    Re: Switching between window forms?

    I will take a look at your signature block tomorrow, thanks.
  35. Replies
    24
    Views
    1,228

    Re: Switching between window forms?

    In post #14, I mentioned "I have tried both fLogin.Visible = false and fLogin.Close(), neither of them actually closes FormLogin, I can see both forms in taskbar, FormLogin just moves behind...
  36. Re: Connection String Variable Declare Error(Type or namespace name could not be foun

    However, mine is not SqlConnection, since I am working on Sybase database, see the link inside code comment.

    Thanks.
  37. Connection String Variable Declare Error(Type or namespace name could not be found)

    https://www.guru99.com/c-sharp-access-database.html

    Trying to practice above link code, but what is the error(attached screenshot) about? It is Sybase, not SQL, but I guess SQL may also work.
    ...
  38. Replies
    24
    Views
    1,228

    Re: Switching between window forms?

    Yes, you are correct about this part("FormLogin is shown automatically when the project starts"). In this case, how to close FormLogin and show FormInterface?



    FormInterface...
  39. Replies
    24
    Views
    1,228

    Re: Switching between window forms?

    var fLogin = new FormLogin();
    var fInterface = new FormInterface();
    fInterface.Show();
    //fLogin.Visible = false;
    fLogin.Close();


    I have tried both fLogin.Visible = false and...
  40. Replies
    24
    Views
    1,228

    Re: Switching between window forms?

    Thanks. Is it valid to have variable with same name in C#? For example: var FormInterface = new FormInterface();

    Where should I declare variable? Right below the class ?

    .Show to load a form,...
Results 1 to 40 of 154
Page 1 of 4 1 2 3 4



Featured


Click Here to Expand Forum to Full Width