About Stephen Jackson Expertise I can help with questions regarding VB.NET syntax and object references, with data interfaces and with the design and creation of robust, data aware object classes. I can also be very helpful with creating distributable applications and provide tricks and tips on .msi creation. I also have extensive experience in designing SQL Server Databases and interfacing them with VB.NET. I try to avoid web specific questions, as that is an area of expertise all its own.
Experience
Experience in the Area: I have been a programmer in Visual Basic since version 1.0 and have worked with VB.NET (which is infinitely more powerful than previous versions) since its initial release and SQL Server, both as a corporate IT professional and professional consultant. I first wrote Basic in 1976 on a TRS 80 and have worked in Visual Basic 1.0 and every subsequent release of Microsoft Visual Basic. I worked for over 7 years as a Senior Level Consultant in the area and currently hold a Project Manager position in IT.
Education and Credentials: MBA in Econometrics, 1983, University of Memphis.
BBA in Financial Management, 1982, Fogelman College of Business and Economics, University of Memphis. Microsoft Certified Professional
Areas of Special Expertise:
My specialty is the design of Object Oriented Solutions with robust, data aware object classes. I generally avoid the classic ‘Three Tier’ model as I find it redundant and cumbersome to maintain. I also specialize in the creation of ‘User Friendly’ User Interfaces which help lessen the need for user training and help prevent user error. I work best with Windows Forms based applications, and while I do work in C# as well, I prefer to limit my questions here to Windows Forms based applications created in Visual Basic.NET and SQL Server. I wil also address questions relating to the distribution and installation of Windows Forms based applications created in VB.NET.
Expert: Stephen Jackson Date: 3/18/2008 Subject: update command
Question my update command works just fine and i have three fields that represents double because they are number fields and in my database i gave them a default value of 0. but when i change those values an error occurs saying something like data truncate on that field. here's my update code by the way:
Dim myquery As New MyClasslibrary.MyHelper
Form3.connect(myquery)
Dim freeserv As Integer = 0
If CheckBox1.Checked Then
freeserv = 1
Else
freeserv = 0
End If
my double fields are TotalAmount, AmountPaid and AmountRemaining. can anyone help how to get rid of the error?
Answer Enrico,
This one will come up a lot. I recently fought with such an error only to finally realize I had entered my update fields in the wrong order! Your situation is probably more subtle. .NET and SQL Server are very sensitive to data type and size so first we will look at the obvious.
Be sure your freeserve to string is not actually returning 'TRUE' or 'FALSE', for example. I am guessing by your code that this is being saved as a string, probably one character? You might set up your variable as a string and set it to 'Y' or 'N'.... in fact, this is the very first thing I would try here!
You need to check the field size for your text fields. Then add a limit to your code (such as a trims and maybe a left function to only allow the maximum size string) to be sure your strings are not too large for the destination field. Also make sure you are not sending an integer to a smaller size numeric field.
Also check your dates to be sure you are not passing a date with a time to a short date field. finally be sure your calculated values are not exceeding the allowable sizes of your destination table fields. A little experimentation will probably reveal the culprit and once revealed, you will probably find it easy to correct. I would look first at that
I hope this helps! If not feel free to let me know and we will try again!