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

Stored Procedure And Dataset

بدأه abbas100 في 27 أبريل 2008 · 4 رد · 882 مشاهدة · في Microsoft Visual C#.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Alsalamu Alaikom.

Sorry for writtung in English.

When I execute a stored procedure that returns a single value using a TableAdapter, I always get error message "Object reference not set to an instance of an object"

I followed all the steps in this MSDN page:

http://msdn2.microsoft.com/en-us/library/37hwc7kt.aspx

but the problem still unsolved.

here are my simple stored procedure:



AS
RETURN 4
   create PROCEDURE  dbo.StoredProcedure1

and here are the simple code in my asp.net webpage that should display the number "4":


{
DataSet1TableAdapters.QueriesTableAdapter TA
= new DataSet1TableAdapters.QueriesTableAdapter();
int i = ( int) TA.StoredProcedure1();
Response.Write(i.ToString());

}
   protected void Button1_Click(object sender, EventArgs e)

you'll find attached a very simple project that demonstrate this problem.

so, please could any one help me?

WebSite10.rar

تم تعديل هذه المشاركة بواسطة abbas100 في 27 أبريل 2008 في 20:23

#2

أعتذر إن لم يكن هذا هو القسم المناسب ولكن أين أضع سؤالي هذا؟

#4

شكرا أخي TareqVB

ولكن كما ترى فإنني استخدمت new بالطريقة الصحيحة.

المشروع مرفق وهو عبارة عن سطرين فقط من الأكواد ، أرجو ممن يستطيع حل هذه المشكلة أن يعدل في المشروع ويرفعه مرة أخرى وأكون له ممتنا.

شكرا لكم

#5

هل الموضوع صعب لهذه الدرجة يا أخوان؟

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