Hi
I’m NOT an expert on vb.net but have created a few applications and can stumble around until I get things working :)(I apologize in advanced for such a long post, I just want to be sure I explained my problem in detail)
I’m evaluating the latest version of your Windows.Forms software using Visual Studio 2010 in VB.net on a Win7 x64 system.(also have 2013 but at the moment just using 2010) I’m trying to bind a WinSchedule with an SQL Express 2008 R2 database, and found the Database Sample in the LEGACY folder of the VB sample… (I wonder if they are up to date?)
I have followed the sample demo to the “T” and have everything working fine (on screen), but have more than just a few odd issues
1. While the Owners SQL Table is being populated with initial owner inserts when selecting UPDATE OWNERS… any further modification of same Owner creates an Error when UPDATING AGAIN. (error: …near NOTHING), meanwhile I can continue to add more Owners without problems.
2. The Appointments SQL Table WILL NOT receive any data at all when electing UPDATE APPOINTMENTS! No matter what I try(or for any owner)! And gives NO ERROR! (Odd because Owners Table at least saves initial data) So I know the connection to the SQL DB is fine.
3. I created the default SQL Tables using the script in the sample dir. (slight editing due to lack of user/pass for SQL Express 2008 R2, but no biggie)
4. I had to modify the Connection String and add a “;” between statements or I would get a Connection string is too long error… (but that was simple enough) Don’t think the connection string has any problems since I can add owners to their table.
I noticed a few fields were NOT in concurrence with the HELP/MANUAL on their NAME/TYPE, For example:
On your online 2014.2 Help/Manual states the Owners Table has a filed named KEY when in fact your sample uses a filed Named OwnerKey the name KEY seems to be reserved in SQL and such name would be renamed to [Key] by SQL DB automatically
Also the sample script created a field in the APPOINTMENT Table called AppointmentID, which is an Index/Key. Which is NOT on your Help/Manual for 2014.2
Maybe some of these discrepancies have to do with your SAMPLE being LAGACY or maybe OUTADTED or maybe where created for the purpose of this DEMO?, and/or maybe in the HELP for those versions, these fields/settings were standard? I REALLY would like any help on this topic…just assume I’m using the sample project DEMO unmodified…I have spent countless hours on HIT & MISS attempts, but would just rather ask and not keep guessing at this.
If anyone has a sample in VB.net that they have created to BIND to an SQL Database with success or if Anyone cares to TEST the Lagacy Sample with ver 2014.2 and give any advice on what to change I would REALLY appreciate the HELP!
I would really like to see this WORKING before I can suggest a purchase of this product to my superiors …Thanks in advanced!
Just as an update....I installed SQL Server Express 2014, re created the database via simple script and added the suggested user for the create script to run unmodified.
Still have SAME EXACT issues... no changeOnly cange in DEMO CODE was to fix the connection string
From:
Private Const DATABASE_CONNECTION_STRING_TEMPLATE As String = "Provider=SQLOLEDB.1Persist Security Info=FalseUser ID={0}Password={1}Initial Catalog={2}Data Source={3}Use Procedure for Prepare=1Auto Translate=TruePacket Size=4096Workstation ID={4}Use Encryption for Data=FalseTag with column collation when possible=False"
To:
Private Const DATABASE_CONNECTION_STRING_TEMPLATE As String = "Provider=SQLOLEDB.;1Persist Security Info=False;User ID={0};Password={1};Initial Catalog={2};Data Source={3};Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID={4};Use Encryption for Data=False;Tag with column collation when possible=False
Notice I just added ";" between con string parameters.... (needed)
Could this possibly a limitation on the 2014.2 winforms DEMO?
Hello Eric,
Thank you for contacting Infragistics Support.
I have checked WINSCHEDULE DATABASE DEMO VB legacy sample and have found some issues, exactly as you described in your post. Please find bellow the fixes I have implement:
1.In order Owner table to work proper you need to set primary key for this table. Please set OwnerKey as primary key. More information regarding how to set primary key in may find by following the next link http://msdn.microsoft.com/en-us/library/ms189039.aspx
2. In order Appointments table to receive updates you need to remove row 228 in DatabaseSupport.vb – this one Me.DataSet.Tables(WinScheduleMSSQLServerSupport.APPOINTMENTS_TABLE_NAME).AcceptChanges()
3. If you can populate data in your data base I assume you did it correctly.
4. You are right, there should be semicolons between connection string parameters. Please note you may use shorter connection string as this one "Provider=SQLOLEDB.1; User ID={0}; Password={1}; Initial Catalog={2}; Data Source={3}; Workstation ID={4};" All other parameters are set to their default values and it is not necessary to set them explicitly.
After all these modifications the sample should work flawlessly.
Please find attached updated version of the legacy sample as well as back-up of data base I have created to test the project. In order to use the back-up file you need to restore it in your SQL Management Studio. For more information how to restore from back-up file please follow the next link http://msdn.microsoft.com/en-us/library/ms177429.aspx
Please let me know if this is what you are looking for or if I am missing something.
Thanks Milko !
That did the trick! Can't believe just 1 line of code and a PK field was all that was off! :)Its now working perfectly!
Now to try and implement code into a blank project to see if I can implement this option into my own style of coding
Much appreciated the Quick Support !