开发者

Creating a basic class in asp.net

开发者 https://www.devze.com 2023-01-12 13:41 出处:网络
I am new to the .Net world, and was wanting to create a class so I can learn OOP. I have a .sln file, with multiple projects in that file. I want to create a class that will accept 3 parameters, a \"

I am new to the .Net world, and was wanting to create a class so I can learn OOP.

I have a .sln file, with multiple projects in that file. I want to create a class that will accept 3 parameters, a "stored proc name", "UserID" and "PageName". The stored proc will log the id of the person who launches a particular page, the page name and the DateTime (which is in the stored proc). This is for internal monitoring of sensitive HR data.

This proc will be called by the multiple projects within my .sln

Can 开发者_开发技巧someone advise me how to create the class, or point me to any resources? Thanks


A class wouldn't accept parameters. A method within a class would accept parameters.

What you're describing is just a method call that takes the parameters and executes a stored procedure on a SQL server. You can find the documentation on doing that just about anywhere. Such as here: http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx

For a basic introduction to Object Oriented Programming, from a .NET perspective, this is as good a place to start as any (and better than many. It teaches in plain English, explaining technical jargon in a clear, understandable manner.). Since you say you're new to .NET and want to learn OOP, I'm not sure if that means "new to programming" or "I've done procedural programming only in the past". Either way, the MSDN Beginner Learning Center has good information regardless of your skill level.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号