SlideShare une entreprise Scribd logo
1  sur  25
Create Database ,[object Object]
Right click on add new item
Choose Database
Make a SQL database named “MyDatabase.mdf”
Database Explorer ,[object Object]
You should see your database “MyDatabase.mdf”
Create a New Table ,[object Object]
Right click on Tables and Add new table
Enter fields into table ,[object Object]
Enter a field name “my_int” and make it type int – make the int an identity field so that it can auto increment and server as a key
Save Table ,[object Object]
Open Table to add data to it ,[object Object]
Enter data into table ,[object Object]
Enter a string in the 'my_varchar' field
You won't need to, nor be allowed to enter data into the my_int field if you set it up as identity because it will auto fill
Get Connect String ,[object Object]
Click on properties
See connection string in lower left properties
ConnectionString extract from Properties ,[object Object]
See next slide for what it should look like when you put it in the code
Connect String You need to modify the connect string that you extract from the properties of the Database so that the compiler will accept it.  Here is a sample connect string: Data Source=.SQLEXPRESS; AttachDbFilename=|DataDirectory| MyDatabase.mdf;Integrated Security=True;User Instance=True;
Create Web Form ,[object Object]
Right click on the website name and add new item
Add a web form names AdoTest.aspx
Indicate that it is using code behind

Contenu connexe

Tendances

New s ta r chart login
New s ta r chart loginNew s ta r chart login
New s ta r chart loginapril_lamb
 
Add or Remove Password Protection in Excel 2016
Add or Remove Password Protection in Excel 2016Add or Remove Password Protection in Excel 2016
Add or Remove Password Protection in Excel 2016Jaff Tiger
 
LookupPoint the 60 second intro
LookupPoint the 60 second introLookupPoint the 60 second intro
LookupPoint the 60 second introDonal Cullen
 
In press checking with crossref API
In press checking with crossref APIIn press checking with crossref API
In press checking with crossref APIukcorr
 
Asp.Net The Data List Control
Asp.Net   The Data List ControlAsp.Net   The Data List Control
Asp.Net The Data List ControlRam Sagar Mourya
 
BlackOps Projects (SQL Server Add-Ins)
BlackOps Projects (SQL Server Add-Ins)BlackOps Projects (SQL Server Add-Ins)
BlackOps Projects (SQL Server Add-Ins)James Schneider
 
Portofolio-Gligor Maria
Portofolio-Gligor MariaPortofolio-Gligor Maria
Portofolio-Gligor Mariamariaaag
 
3 useful secrets to excel for the student
3 useful secrets to excel for the student3 useful secrets to excel for the student
3 useful secrets to excel for the studentdonaldquixotec
 
Access 2 day course
Access 2 day courseAccess 2 day course
Access 2 day coursescacpa
 
Erik King Setfocus
Erik King SetfocusErik King Setfocus
Erik King Setfocusgervaisking
 
B.sc i agri u 4 introduction to ms access
B.sc i agri u 4 introduction to ms accessB.sc i agri u 4 introduction to ms access
B.sc i agri u 4 introduction to ms accessRai University
 
How to Combine text from two or more cells in Excel
How to Combine text from two or more cells in ExcelHow to Combine text from two or more cells in Excel
How to Combine text from two or more cells in ExcelNick Weisenberger
 
Security concerns in microsoft share point 2013
Security concerns in microsoft share point 2013Security concerns in microsoft share point 2013
Security concerns in microsoft share point 2013Ramasubramanian Thumati
 
Terry Reese - Real-world data editing with MarcEdit
Terry Reese - Real-world data editing with MarcEditTerry Reese - Real-world data editing with MarcEdit
Terry Reese - Real-world data editing with MarcEditKohaGruppoItaliano
 
Introduction to students-intranet only
Introduction to students-intranet onlyIntroduction to students-intranet only
Introduction to students-intranet onlyvogtf
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverAmmara Arooj
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Aeric Poon
 

Tendances (20)

New s ta r chart login
New s ta r chart loginNew s ta r chart login
New s ta r chart login
 
Add or Remove Password Protection in Excel 2016
Add or Remove Password Protection in Excel 2016Add or Remove Password Protection in Excel 2016
Add or Remove Password Protection in Excel 2016
 
Digital tools
Digital toolsDigital tools
Digital tools
 
LookupPoint the 60 second intro
LookupPoint the 60 second introLookupPoint the 60 second intro
LookupPoint the 60 second intro
 
In press checking with crossref API
In press checking with crossref APIIn press checking with crossref API
In press checking with crossref API
 
Asp.Net The Data List Control
Asp.Net   The Data List ControlAsp.Net   The Data List Control
Asp.Net The Data List Control
 
BlackOps Projects (SQL Server Add-Ins)
BlackOps Projects (SQL Server Add-Ins)BlackOps Projects (SQL Server Add-Ins)
BlackOps Projects (SQL Server Add-Ins)
 
Portofolio-Gligor Maria
Portofolio-Gligor MariaPortofolio-Gligor Maria
Portofolio-Gligor Maria
 
3 useful secrets to excel for the student
3 useful secrets to excel for the student3 useful secrets to excel for the student
3 useful secrets to excel for the student
 
Access 2 day course
Access 2 day courseAccess 2 day course
Access 2 day course
 
Erik King Setfocus
Erik King SetfocusErik King Setfocus
Erik King Setfocus
 
Crm 4.0 customizations basics
Crm 4.0 customizations basicsCrm 4.0 customizations basics
Crm 4.0 customizations basics
 
B.sc i agri u 4 introduction to ms access
B.sc i agri u 4 introduction to ms accessB.sc i agri u 4 introduction to ms access
B.sc i agri u 4 introduction to ms access
 
How to Combine text from two or more cells in Excel
How to Combine text from two or more cells in ExcelHow to Combine text from two or more cells in Excel
How to Combine text from two or more cells in Excel
 
Security concerns in microsoft share point 2013
Security concerns in microsoft share point 2013Security concerns in microsoft share point 2013
Security concerns in microsoft share point 2013
 
Terry Reese - Real-world data editing with MarcEdit
Terry Reese - Real-world data editing with MarcEditTerry Reese - Real-world data editing with MarcEdit
Terry Reese - Real-world data editing with MarcEdit
 
Fundamental of SPSS
Fundamental of SPSSFundamental of SPSS
Fundamental of SPSS
 
Introduction to students-intranet only
Introduction to students-intranet onlyIntroduction to students-intranet only
Introduction to students-intranet only
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql server
 
Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...Tutorial on how to load images in crystal reports dynamically using visual ba...
Tutorial on how to load images in crystal reports dynamically using visual ba...
 

En vedette

En vedette (6)

MPages at Lpch - Thus Far
MPages at Lpch - Thus FarMPages at Lpch - Thus Far
MPages at Lpch - Thus Far
 
Visual Design of Clnical Dashboards
Visual Design of Clnical DashboardsVisual Design of Clnical Dashboards
Visual Design of Clnical Dashboards
 
Ud l 23oct
Ud l 23octUd l 23oct
Ud l 23oct
 
The Near Future of CSS
The Near Future of CSSThe Near Future of CSS
The Near Future of CSS
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 

Similaire à Ado Presentation

Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studioAravindharamanan S
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studioAravindharamanan S
 
Open microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletOpen microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletMitchinson
 
Once the Application has started up and you are at the Start Page, s.docx
Once the Application has started up and you are at the Start Page, s.docxOnce the Application has started up and you are at the Start Page, s.docx
Once the Application has started up and you are at the Start Page, s.docxarnit1
 
systems labOnce the Application has started up and you are at the .docx
systems labOnce the Application has started up and you are at the .docxsystems labOnce the Application has started up and you are at the .docx
systems labOnce the Application has started up and you are at the .docxperryk1
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationRandy Connolly
 
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx        Greetings and Salutations.docxCIS407AWk2iLabDefault.aspx        Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docxclarebernice
 
Previous weeks work has been uploaded as well as any other pieces ne.docx
Previous weeks work has been uploaded as well as any other pieces ne.docxPrevious weeks work has been uploaded as well as any other pieces ne.docx
Previous weeks work has been uploaded as well as any other pieces ne.docxkeilenettie
 
Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.netNgeam Soly
 
Style Intelligence Evaluation Documentation
Style Intelligence Evaluation DocumentationStyle Intelligence Evaluation Documentation
Style Intelligence Evaluation DocumentationArleneWatson
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPAli Shah
 
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...WithTheBest
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Cathie101
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universitylhkslkdh89009
 

Similaire à Ado Presentation (20)

Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
ASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NETASP.NET 09 - ADO.NET
ASP.NET 09 - ADO.NET
 
Open microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutletOpen microsoft visual studio/tutorialoutlet
Open microsoft visual studio/tutorialoutlet
 
Once the Application has started up and you are at the Start Page, s.docx
Once the Application has started up and you are at the Start Page, s.docxOnce the Application has started up and you are at the Start Page, s.docx
Once the Application has started up and you are at the Start Page, s.docx
 
systems labOnce the Application has started up and you are at the .docx
systems labOnce the Application has started up and you are at the .docxsystems labOnce the Application has started up and you are at the .docx
systems labOnce the Application has started up and you are at the .docx
 
ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
 
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx        Greetings and Salutations.docxCIS407AWk2iLabDefault.aspx        Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
 
Previous weeks work has been uploaded as well as any other pieces ne.docx
Previous weeks work has been uploaded as well as any other pieces ne.docxPrevious weeks work has been uploaded as well as any other pieces ne.docx
Previous weeks work has been uploaded as well as any other pieces ne.docx
 
Mvc acchitecture
Mvc acchitectureMvc acchitecture
Mvc acchitecture
 
Chapter 3: ado.net
Chapter 3: ado.netChapter 3: ado.net
Chapter 3: ado.net
 
Create Components in TomatoCMS
Create Components in TomatoCMSCreate Components in TomatoCMS
Create Components in TomatoCMS
 
2310 b 10
2310 b 102310 b 10
2310 b 10
 
Style Intelligence Evaluation Documentation
Style Intelligence Evaluation DocumentationStyle Intelligence Evaluation Documentation
Style Intelligence Evaluation Documentation
 
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISPMCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
MCS,BCS-7(A,B) Visual programming Syllabus for Final exams @ ISP
 
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
Line Graph Analysis using R Script for Intel Edison - IoT Foundation Data - N...
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
ADO.NET by ASP.NET Development Company in india
ADO.NET by ASP.NET  Development Company in indiaADO.NET by ASP.NET  Development Company in india
ADO.NET by ASP.NET Development Company in india
 
Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0Dynamic Web Pages Ch 4 V1.0
Dynamic Web Pages Ch 4 V1.0
 
Cis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry universityCis407 a ilab 3 web application development devry university
Cis407 a ilab 3 web application development devry university
 

Plus de Rebecca Peltz

Hosting video js friends (2)
Hosting video js friends (2)Hosting video js friends (2)
Hosting video js friends (2)Rebecca Peltz
 
Intro chrome extensions
Intro chrome extensionsIntro chrome extensions
Intro chrome extensionsRebecca Peltz
 
Make an html validator extension
Make an html validator extensionMake an html validator extension
Make an html validator extensionRebecca Peltz
 
Make an language translator with voice extension
Make an language translator with voice extensionMake an language translator with voice extension
Make an language translator with voice extensionRebecca Peltz
 

Plus de Rebecca Peltz (7)

Hosting video js friends (2)
Hosting video js friends (2)Hosting video js friends (2)
Hosting video js friends (2)
 
Gitbook FAQs
Gitbook FAQsGitbook FAQs
Gitbook FAQs
 
Gitbook Publish FAQ
Gitbook Publish FAQGitbook Publish FAQ
Gitbook Publish FAQ
 
Meetup gitbook
Meetup gitbookMeetup gitbook
Meetup gitbook
 
Intro chrome extensions
Intro chrome extensionsIntro chrome extensions
Intro chrome extensions
 
Make an html validator extension
Make an html validator extensionMake an html validator extension
Make an html validator extension
 
Make an language translator with voice extension
Make an language translator with voice extensionMake an language translator with voice extension
Make an language translator with voice extension
 

Dernier

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 

Dernier (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

Ado Presentation

  • 1.
  • 2. Right click on add new item
  • 4. Make a SQL database named “MyDatabase.mdf”
  • 5.
  • 6. You should see your database “MyDatabase.mdf”
  • 7.
  • 8. Right click on Tables and Add new table
  • 9.
  • 10. Enter a field name “my_int” and make it type int – make the int an identity field so that it can auto increment and server as a key
  • 11.
  • 12.
  • 13.
  • 14. Enter a string in the 'my_varchar' field
  • 15. You won't need to, nor be allowed to enter data into the my_int field if you set it up as identity because it will auto fill
  • 16.
  • 18. See connection string in lower left properties
  • 19.
  • 20. See next slide for what it should look like when you put it in the code
  • 21. Connect String You need to modify the connect string that you extract from the properties of the Database so that the compiler will accept it. Here is a sample connect string: Data Source=.SQLEXPRESS; AttachDbFilename=|DataDirectory| MyDatabase.mdf;Integrated Security=True;User Instance=True;
  • 22.
  • 23. Right click on the website name and add new item
  • 24. Add a web form names AdoTest.aspx
  • 25. Indicate that it is using code behind
  • 26.
  • 27. We'll code the database read and data rendering in the code behind
  • 28. We'll put cod in Page_Load method
  • 29.
  • 30. Create a Sql Connection using the string
  • 31. Note the red squigly line under SqlConnection
  • 32.
  • 33. Correct this error and remove the red line
  • 34.
  • 35. To select the data we created in the database use this sql:
  • 37.
  • 38. Open connections are like open pipes to the database – you will need to close it when you are done
  • 39.
  • 40.
  • 41. See comments in code on the next slide as to how data is extracted form the reader
  • 42. Extracting Data from a SqlDataReader When you extract data from a reader, you should be aware of the data type you are extracting and how it maps to the language (.net) data types
  • 43. Code to iterate through a reader while (reader.Read()) { //my_varchar is varchar which maps to .net string so use GetString string name = reader.GetString(0); //my_int is int which maps to Int32 Int32 id = reader.GetInt32(1); //now that I have loaded the data into c# string I can output //here I'm using response.write to output directly to the //browser. //I concatenate the data with html to produce the 'layout' //I want Response.Write(name + &quot; &quot; + id + &quot;<br />&quot;); }
  • 44.
  • 45. If you don't close the connection you will run into problems with the database – it will think you are still connected
  • 46.
  • 47. This will force your code to compile and bring up a browser window with the response
  • 48. To do this right click on the .aspx file in the solution explorer and choose to 'View in Broswer'
  • 49.
  • 50.
  • 51. This table can be styled if needed
  • 52.