Announcement

Collapse
No announcement yet.

A Shot in the Dark: Any C# and/or SQL guys here?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • A Shot in the Dark: Any C# and/or SQL guys here?

    I guess the title pretty much says it all. I'm trying to cut my teeth on a C# application that's a bit out of my depth, and if there's anyone here with a knowledge of C# and/or SQL (preferably and ), who'd be willing to share some of your time, I'd appreciate it.

  • #2
    I've got the OR part covered... never dealt with C#, but if it's just basic algorithmic logic, I might be able to give you a hand.

    Comment


    • #3
      I think C# is just Java by Microsoft. I don't have any useful experience with either though

      Comment


      • #4
        I know java... it's bad enough without being designed by microsoft, haha.

        Comment


        • #5
          Originally posted by Freyr View Post
          I've got the OR part covered... never dealt with C#, but if it's just basic algorithmic logic, I might be able to give you a hand.
          Well, basically my problem is that I'm trying to populate a drop down list combo box with data from a specific column in a SQL data base. The Rows hold profile data for the application (versus storing the config values in the registry).

          I'm using a foreach loop to populate the list, but it's counting the row that's the "add new row" row (if that makes sense). So even though my stored procedure is "Select * from Table where ProfileName is not null" it's still counting that in the DataSet.

          (Looking at this, it sounds like more of a C# issue, actually).

          As for C# being "Java by Microsoft" I couldn't disagree more. C# is a nifty language. I was sold on it the first couple of times I used it. I used to dabble in Visual Basic and I now write in C++ for my job. C# seems like a logical marriage of VB and C/C++.

          Comment


          • #6
            Yeah, doesn't sound like a SQL problem persay, unless there are some weird unescaped characters messing around (it's happened).

            See, I can't stand VB/Flash/Javascript from a programming perspective. I learned them because it was needed for various jobs... so I don't willing go out and learn languages like C#... I'd rather learn brainfuck

            Comment


            • #7
              Originally posted by Freyr View Post
              Yeah, doesn't sound like a SQL problem persay, unless there are some weird unescaped characters messing around (it's happened).

              See, I can't stand VB/Flash/Javascript from a programming perspective. I learned them because it was needed for various jobs... so I don't willing go out and learn languages like C#... I'd rather learn brainfuck
              Well, it's definitely a step forward for us at work. We are using Borland C++ builder 5 and as a Visual Studio guy, I absolutely hate Borland. We use quite a few different GUI type things that I find much easier to do in C# than in VC++.

              Comment


              • #8
                Oh yeah, C++ is atrocious for GUI interfaces. I usually take the cheap way out and use the allegro library. I do mostly backend modules though, so it's all bash shell and g++. Borland was always one of the worst, imo. Dev-Cpp is an awesome (free) IDE.

                Comment


                • #9
                  Originally posted by Freyr View Post
                  Oh yeah, C++ is atrocious for GUI interfaces. I usually take the cheap way out and use the allegro library. I do mostly backend modules though, so it's all bash shell and g++. Borland was always one of the worst, imo. Dev-Cpp is an awesome (free) IDE.
                  Well, thanks for the help. The geeks at the MSDN forum don't seem to be capable of comprehending the issue either.

                  The ironic thing is that we're switching to C# due to it's better integration with SQL (supposedly). Most of the server side of things will actually be GUI-less in the near future, and that's nice. I am trying to get a head start on the learning curve!

                  Comment


                  • #10
                    I code in C# and SQL all the time...but not for UI work, so I don't know the answer to your question. i will tell you this...almost every C#/SQL question I have ever had, I found the answer pretty quickly through google.
                    http://www.youtube.com/watch?v=eKgPY1adc0A

                    Comment


                    • #11
                      It has been a while but I think another approach to this is to set the datasource of the combobox to the query result rather than for-looping. I second Seventh's advice. Google sees all, knows all.

                      Comment


                      • #12
                        Originally posted by SeventhSon View Post
                        I code in C# and SQL all the time...but not for UI work, so I don't know the answer to your question. i will tell you this...almost every C#/SQL question I have ever had, I found the answer pretty quickly through google.
                        Originally posted by Tashtego View Post
                        It has been a while but I think another approach to this is to set the datasource of the combobox to the query result rather than for-looping. I second Seventh's advice. Google sees all, knows all.
                        Thanks, but I do not want to bind the controls. I went that route initially (that's how I used to do it in VB with Access, so that seemed natural), but that introduced a few different problems.

                        I'm sure I'll get it figured out...

                        Comment


                        • #13
                          Originally posted by thetroy View Post
                          I think C# is just Java by Microsoft. I don't have any useful experience with either though
                          C# is not just Java by Microsoft. But your second sentence is pretty true.
                          I want REAL change. I want dead bodies littering the capitol.

                          - Newc

                          Comment


                          • #14
                            Why not just put a test to see if the field is empty before adding it to the combobox? Something like (and this is in VB, not C#, but you should get the picture)

                            For Each item as String in items
                            If item <> "" Then
                            cmbList.Add(item)
                            End If
                            Next


                            And not to get too far OT, but in my opinion C# is MS's attempt at a Java-like language.
                            Scott

                            Comment


                            • #15
                              Originally posted by Spivonious View Post
                              Why not just put a test to see if the field is empty before adding it to the combobox? Something like (and this is in VB, not C#, but you should get the picture)

                              For Each item as String in items
                              If item <> "" Then
                              cmbList.Add(item)
                              End If
                              Next


                              And not to get too far OT, but in my opinion C# is MS's attempt at a Java-like language.
                              Now that's a forehead slapping suggestion.
                              I'll give that a go when I get home tonight. Thanks.

                              Comment

                              Working...
                              X