Mã nguồn bài học Onlineshop:
Khóa học làm dự án thực tế với ASP.NET MVC, WebAPI, AngularJS:
Trong bài học này mình sẽ hướng dẫn các bạn các bước sau:
– Ghép giao diện trang login vào hệ thống
– Tạo mới Login Model
– Tạo tầng Models và cài đặt Entity Framework
– Tạo tầng Code first bằng Entity Framwork tool for Visual
– Tao view Login bằng HTML Razor
– Login và thông báo lỗi bằng Razor
Để tham khảo cách đăng nhập qua Entity linq các bạn xem video này:
Mội số lỗi: No connection string named ‘xxx’ could be found in the application config file. Các bạn nên copy chuỗi connection string được tự gen ra trong App.config sang web.config. Vì khi chạy web thì connection sẽ được đọc ở web.config
Lỗi 2:
Additional information: No Entity Framework provider found for the ADO.NET provider with invariant name ‘System.Data.SqlClient’. Make sure the provider is registered in the ‘entityFramework’ section of the application config file. See for more information.
Là do chưa cài Entity Framework cho project
ASP.NET MVC – #5: Tạo trang đăng nhập qua Store Procedure | Login with Store procedure | TEDU
▶ More information about TEDU:
Website:
Hotline: 0966 036 626
Email: tedu.international@gmail.com
▶ CLICK TO SUBSCRIBE:
#tedu #aspnetmvc #mvc
DO NOT REUPLOAD
Nguồn: https://technewsgator.com
Xem thêm bài viết khác: https://technewsgator.com/lap-trinh/
Xem thêm Bài Viết:
- [Khóa học lập trình C# Cơ bản] – Bài 3: Nhập xuất cơ bản | HowKteam
- Lập Trình Joomla – Bài 185: Xây Dựng Cấu Trúc Template 01
- Phần 2 – Demo game Snake [Lập trình game cơ bản]
- [Lập trình C/C++] Bài 1_1. Hướng dẫn các thao tác căn bản trên Visual Studio 2013 và 2015(Phần 1)
- Tự học PHP – Bài 100 Làm việc với Session – Phần 1
ad ơi cho em hỏi em bi lỗi này mặc dù cái procedure đó nó nằm ở trong sql ạ System.Data.SqlClient.SqlException: 'Could not find stored procedure 'Sp_AccountLogin'.'
ad ơi e làm tới phút 12:47 thì nó ko nhận accountmodel, nó hiện như vậy class-is-inaccessible-due-to-its-protection-level. ad giúp e xử lý với
Cảm ơn anh nhiều !
anh chị nào có code phần này ko em xin với ạ
mình bị dính lỗi như này : <%@ Application Codebehind="Global.asax.cs" Inherits="Webbanhang.Global" Language="C#" %>
visual: 2019; Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4075.0
Cho mình hỏi có ai bị lỗi này k ạ? fix như nào vậy ạ?
No mapping exists from object type System.Data.SqlClient.SqlParameter[] to a known managed provider native type.
Tedu ơi, mình chạy thì bị lỗi could not find stored procedure. Trong SQL server mình đã tạo rồi, connectionString cũng đã add, mà không chạy được
bài này dạy nhanh quá. khó theo kịp
Mình xin được update thêm 1 chút nữa là cái đoạn viết Store Procedure khi bạn count số user ra thì nên select limit 1 để cho tối ưu câu SQL bạn nhỉ ? 🙂
Cho e cái data base được ko a
cho em hỏi lỗi "No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information." sửa như nào ạ
Anh ơi bị lỗi này như nào ạ System.InvalidOperationException: 'No connection string named 'BookStoreDbContext' could be found in the application config file.'
nhiều đoạn cứ tương tự như webform trong khi mình đã học webform đâu.haizzz
mình thấy nói khó nghe quá.kiểu các câu chữ ko rõ ràng :(( kiểu câu được câu không.lại nhiều khái niệm mới.nghe đi nghe lại vẫn ù ù cạc cạc :((
mình không tìm ra phương thức HttpContext.Current.
anh ơi cho em hỏi với ạ. khi em chạy nó hiện lên
No connection string named 'OnlineResDbContect' could be found in the application config file.
nhưng chuoix kết nối có trong app.config trong class libary Model. cho em hỏi cách sửa với ạ
USE [OnlineShopping]
GO
/**** Object: StoredProcedure [dbo].[Sp_Account_Login] Script Date: 12/19/2019 3:57:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Sp_Account_Login]
@Username nvarchar(50),
@Password nvarchar(50)
AS
BEGIN
declare @count int
declare @res bit
select @count =count(*) from Account where Username = @Username and Password = @Password
if @count>0
set @res=1
else
set @res=0
select @res
END
sao em chuột phải chọn modify ở proc lại bi lõi ở cái ALTER PROCEDURE [dbo].[Sp_Account_Login]
a nhỉ! xEm hộ em cái
<Chắc ai đó sẽ cần>
use [OnlineShop]
go
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[Sp_Account_Login]
@UserName nvarchar(20),
@PassWord nvarchar(50)
as
begin
declare @count int
declare @res bit
select @count =count(*) from Account where UserName = @UserName and PassWord=@PassWord
if @count >0
set @res=1
else
set @res=0
select @res
end
sao anh gõ code VS tự động import các dòng using vậy ạ. Anh có sử dụng tool gì không chỉ em với ạ
15:26 loginSession đâu ra vậy ạ. Trước em k thấy anh khai báo
10:35 các biến @UserName và @Password ở đâu ra vậy anh. Trước em k thấy anh khai báo gì cả
Gãy ngay từ đây rồi a ơi.
cho em xin database vào mail buituan71099@gmail.com được không ạ
Anh cho e xin database qua mail: Quancom.vts@gmail.com được không ạ?? Em cảm ơn !!!
Anh ơi làm ơn cho em xin cái database qua mail : lehungnthao@gmail.com