الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

كيف يمكن تمرير قيم متغيرات الى اجراء في الsql

مغلق
بدأه rifat في 6 يونيو 2002 · 2 رد · 607 مشاهدة · في منتدى تصميم صفحات الويب
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم

سعيدة جدا بمنتداكم الذي يحق لي ان افخر ...

والذي ان شاء الله يجد فية كل مبرمج ظالته ..

انا مبرمجة مبتدئة في الasp وواجهتني مشكلة وهي كيف لي ان امرر قيم متغيرات استرجعت عن طريق الrequest من حقل نص الى متغير . واريد ان امرر هذا المتغير بما يحملة من قيمة الى stored procedure في ال sql

اريد كود يبين لي هذه الكيفية..

وهل يكون نفس العملية عند التمرير الclass في الdll

ولكم جزيل شكري وتقديري

#2

As I understood ,you are trying to pass a n integer value which you got from a request.You just need to convert this value to integer and then use the Parameter property of the stored procedure.

Example:

lets say you have a stored procedure that takes one parameter of type integer.

'convert the value to integer
ID = CInt(Request.QueryString("id"))

SET com = Server.CreateObject("ADODB.Command")
'add the command name, This should be the ssame as the name in SQL Server
com.Text = "MyCom"
'this the type
Const adCmdStoredProc = &H0004
com.Type = adCmdStoredProc

com.ActiveConnection = "your connection string" like ODBC name or SQL server values"
'the @ID parameter should be present in your procedure
com.Parameters.Append .CreateParameter("@ID", adSmallInt, adParamInput, 10)
'Now pass the value to the procedure
com..Parameters("@ID") = ID
com.Execute

Hope this will help

Tahiyati

Madani

#3

هناك أمثلة عدة منها التالي :

[l]

' for example

Dim mark1

Dim mark2

mark1=23

mark2=56

function getTotal(stdId,mark1,mark2)

set rs=conn.execute("select * from tabl where id="&stdId)

if rs.eof then

response.write "student not found"

else

getTotal=mark1+mark2

end function

stdId=request.QueryString("stdId")

getTotal stdId,mark1,mark2

[/l]

طبعا هذا مثال للتوضيح فقط .. ممكن ايضا تستفيدي من الأمثلة المطروحة في ورشة العمل في هذا الموقع ..

http://as4web.cjb.net

اختاري من الصفحة الرئيسية ورشة العمل و انظري الأمثلة ..

بالتوفيق..

You can fly while you can touch the sky

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…