Search results for query: *

  1. cwnonthehill

    Invalid attempt to read when no data is present.

    Yes, OBVIOUSLY, they aren't the same code. No thanks for pointing that out. One works just as well as the other. Maybe you've spent a little too much time on this forum, take a break would ya? Sheesh... Not sure why I've been so gracious of your help, I'll switch forums now.
  2. cwnonthehill

    Invalid attempt to read when no data is present.

    I know, that's what I used, see above. Thanks.
  3. cwnonthehill

    Invalid attempt to read when no data is present.

    Thanks! I was able to resolve this issue by using the following code... wcCon.Open() wcDr = wcCmd1.ExecuteReader DoWhile wcDr.Read IfNot IsDBNull(wcDr(0)) Then wcAutoComplete.Add(wcDr.GetString(0)) EndIf Loop...
  4. cwnonthehill

    Invalid attempt to read when no data is present.

    Data is Null. This method or property cannot be called on Null values. UPDATE: If i move the IF statement to inside the Do While statement, i get the error "Data is Null. This method or property cannot be called on Null values." Code is below, help? :) wcCon.Open() wcDr =...
  5. cwnonthehill

    Invalid attempt to read when no data is present.

    Hey guys, I am using an SqlDataReader to gather data for a DataGridView AutoComplete. In the case that one of the rows has a Null value in the database, Visual Studio throws the error "Invalid attempt to read when no data is present." My code is below, any suggestions? wcCon.Open()...
  6. cwnonthehill

    Question Filter DataGridView by string in format of MMddyyyy

    Sorry, I figured it out. I had changed the SQL table back to datetime, but forgot to change my DataSet type to System.DateTime. Thanks again for your help, brilliant as always!
  7. cwnonthehill

    Question Filter DataGridView by string in format of MMddyyyy

    myMaskedTextBox.Text = myDateTime.ToString("MM/dd/yyyy") Thanks, the code above worked great for what i was attempting. And within using that, I discovered something you had attempted to point out to me. A String cant be reformatted as a String. So first I had to declare the table item as a...
  8. cwnonthehill

    Question Filter DataGridView by string in format of MMddyyyy

    Its quite obvious that the data in sql server is binary. What it returns to VB is what I have to work with unfortunately. I do not want to use a DTP as it is more time consuming and is frowned upon by the customer. The masked textbox with mask of __/__/____ ends up looking like 11/20/12__...
  9. cwnonthehill

    Question Filter DataGridView by string in format of MMddyyyy

    I learned your point the hard way, worst part is I knew better. The reason I did this to begin with is because the datetime SQL data type stores my dates like 01/01/2012 as 1/1/2012 and when i populate masked Text Boxes they are all flubbed up. I still havn't found a good way to resolve that. Do...
  10. cwnonthehill

    Question Filter DataGridView by string in format of MMddyyyy

    ok, guys, I have a SQL database with a column called "Date" but with a format of "nchar(8)" so examples of field data are... 12112012 01012013 02022013 etc... In VB i have a DGV that is databound to this sql table. So, my second column in the DGV is the same as what i have explained above...
  11. cwnonthehill

    Problem saving New Row's to multiple tables VB/SQLServer

    Actually, I think I understand what your saying now, but it goes against what I thought was correct. I guess when it comes to SELECT commands, it doesn't generate a problem using the same DataAdapter, but when UPDATING/INSERTING, is when the problem comes in to play. I am going to create new...
  12. cwnonthehill

    Problem saving New Row's to multiple tables VB/SQLServer

    For instance, the following works with no problems, to fill my form... conString = "server=vmsqltest; database=eadb-complaints; trusted_connection=true;" con = New SqlConnection(conString) con.Open() dc = New SqlCommand("SELECT * FROM tblReason ORDER BY...
  13. cwnonthehill

    Problem saving New Row's to multiple tables VB/SQLServer

    Ian, thanks for your help. I am unsure if we are on the same page regarding the DataAdapter, I have used in this same application, and in applications before, the same DataAdapter to Fill multiple tables in the DataSet. So, the idea that you say I need a seperate DataAdapter for each table seems...
  14. cwnonthehill

    Problem saving New Row's to multiple tables VB/SQLServer

    Hey guys, I'm having a little trouble making multiple row inserts to different tables. Below is my code. The idea is basically to create new rows in the dataset, then Insert those new rows to my SQL database. The first set (tblComplaint) gets inserted fine. Then when it attempts to Insert...
  15. cwnonthehill

    Preparing my app for ERROR

    That's what I've been considering, but I'd like to know if it is working somehow. Not sure how to test this unless i can TELL my app to throw an error for testing purposes? Also, I am trying to use my app.config file to enable error logging using the FileLog and EventLog, but when attempting to...
  16. cwnonthehill

    Preparing my app for ERROR

    Thanks for your reply Ian, I have Try/Catch/Finally statements in my application, but those don't account for Errors of the sort I am unprepared for. Is there a way to globally handle these types of errors? For instance, the Application Events in VS2010 looks like what I might be needing...
  17. cwnonthehill

    Preparing my app for ERROR

    Hey guys, I have completed work on my application, and during testing here in the office it occasionally will throw an Unhandled Exception error, mainly related to Crystal Reports which I know I can remedy by having CR installed on the end-user's PC. The one thing I find odd is that in those...
  18. cwnonthehill

    Question Parent/Child table's in SQL SERVER?

    that is a great thread! i'll play with your example some on my next project. thanks for the help!
  19. cwnonthehill

    Question Parent/Child table's in SQL SERVER?

    thanks jmcilhinney, that put a lot of things i had already learned into a sort of organized set of operations i needed to see, but the main thing i was missing was GetChildRows from the DataRelation. once i figured that out it all fell into place! thanks again, problem solved!
  20. cwnonthehill

    Question Parent/Child table's in SQL SERVER?

    Hey guys, I'm new to the forum, so thanks in advance for your time and help!! I will do my best to explain my situation... I have two SQL Tables and am using VB to represent a user interface for adding/editing this data... Below are screenshots of my two tables tblCollection =========== and...
Back
Top