Open the Utilities Solution.sln file contained in the VB2017\Chap11\Utilities Solution- DataGrid folder. Create a SQL Se

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Open the Utilities Solution.sln file contained in the VB2017\Chap11\Utilities Solution- DataGrid folder. Create a SQL Se

Post by answerhappygod »

Open the Utilities Solution.sln file contained in theVB2017\Chap11\Utilities Solution- DataGrid folder. Create a SQLServer database named Utilities.mdf. Add the Bills table definitionshown in Figure 11-64 to the database. The Month field’s (IsIdentity), Identity Increment, and Identity Seed properties are setto True, 1, and 1, respectively. (Recall that you need to expandthe Identity Specification property to access these properties.)After defining the table, click the Update button and then clickthe Update Database button. Open the Data Sources window and startthe Data Source Configuration Wizard. Connect the Utilities.mdffile to the application. Include the entire Bills table in thedataset. Set the Utilities.mdf file’s Copy to Output Directoryproperty to “Copy if newer” Drag the Bills table to the form. Setthe DataGridView control’s AutoSizeColumnsMode property to Fill.Open the DataGridView control’s task list and click Dock in ParentContainer. Click Edit Columns. Change the Month column’sAutoSizeMode property to ColumnHeader. Click Electricity in theEdit Columns dialog box, click DefaultCellStyle, click the ...(ellipsis) button, click Format, click the ... (ellipsis) button,click Numeric, and then click the OK button. The Format box nowshows N2. Change the Alignment property to MiddleRight and thenclick the OK button to close the CellStyle Builder dialog box. Now,format the Water and Gas columns using the Numeric setting with twodecimal places. Also, align the values in both columns using theMiddleRight setting. When you are finished setting the properties,close the Edit Columns dialog box. Change the form’s Size propertyto 330, 200. Open the Code Editor window and enter an appropriateTry...Catch statement. Save the solution and then start theapplication. Enter the three records shown in Figure 11-64. (Recallthat the Month field is an auto-numbered field. The numbers 1, 2,and 3 will appear when you click the Save Data button.) Stop theapplication and then start it again to verify that the threerecords were saved.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply