为什么我们要在asp.net Web应用程序中声明参数 [英] why we are declaring parameters in asp.net web app

查看:60
本文介绍了为什么我们要在asp.net Web应用程序中声明参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的项目中进行开发时,我们在声明参数,为什么我们使用参数并设置和获取该参数的方法,请任何人深入地告诉我.然后,我将以一种观点继续我的项目.以及为什么我们使用cmd.parameters.clear();

while developing in our project we are declaring parameters why we use parameters and set and get methods to that parameters pls any one tell me in depth.then i will continue my project with one view. and also why we use cmd.parameters.clear();

推荐答案

我们怎么可能告诉您为什么在您的代码中正在做某些事情?

等等,这是一个水晶球,当我们需要了解客户真正想要的东西时,我们会用到它.也许如果我专心致志,我可以将其重新用于此任务...
How can we possibly tell you WHY something is being done in YOUR code?

Oh wait... here''s a crystal ball that we keep handy for when we need to devine what our customers REALLY want. Maybe if I concentrate hard enough, I can repurpose it for this task...


首先,您需要在开始项目之前研究面向对象编程的核心概念.

Set和Get是属性而不是方法.属性用于将字段封装到其中.

参数是在方法或存储过程中使用的变量.
有两种类型的参数,实际参数和形式参数.
实际参数是您发送给函数的值.
正式将收集该变量的值.

如果"cmd"是它的对象,则cmd.parameters.clear()是CommadClass的方法.顾名思义,它将清除()所有参数.

我希望它能给您一点点创意,但是要深入了解,您必须从书籍,网络文章中学习它,因为Google是您的朋友.
First of all, you need to study the core concept of Object oriented programming before starting your project.

Set and Get are the properties not the methods. Properties are used to encapsulates the fields into it.

Parameters are the variable which are used within the methods or stored procedures.
there are two type of parameters, Actual and formal.
Actual parameter are the value which you send to the function.
Formal will collects the value of that variable.

cmd.parameters.clear() is the method of the CommadClass If "cmd" is the object of it. As the name suggest it will clear() all the parameters.

I hope it has given you a little Idea, but to know in depth you have to study about it from books, articles on web as google is your friend.


这篇关于为什么我们要在asp.net Web应用程序中声明参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆