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 login
april_lamb
 
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 Maria
mariaaag
 
Access 2 day course
Access 2 day courseAccess 2 day course
Access 2 day course
scacpa
 
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
Ammara Arooj
 

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 (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

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
arnit1
 
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
perryk1
 
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx        Greetings and Salutations.docxCIS407AWk2iLabDefault.aspx        Greetings and Salutations.docx
CIS407AWk2iLabDefault.aspx Greetings and Salutations.docx
clarebernice
 
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
keilenettie
 
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.0
Cathie101
 
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
lhkslkdh89009
 

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 (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

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Dernier (20)

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
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
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 

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.