البرمجة

تخزين Session في ASP.NET C#

To resolve the error, you need to ensure that the data type of the Uid property in your BookingTb class matches the data type of the Uid column in your database, which is VARCHAR(50).

In your BookingTb class, make sure that the Uid property is defined as a string, like this:

csharp
public class BookingTb { // Other properties... public string Uid { get; set; } // Other properties... }

With this change, you can assign the user variable directly to the Uid property without any conversion:

csharp
b.Uid = user;

This should resolve the error, and your code should work correctly to store the Uid in the BookingTb table.

المزيد من المعلومات

لحل مشكلتك، يجب عليك التأكد من أن نوع البيانات لخاصية Uid في فئة BookingTb يتطابق مع نوع البيانات لعمود Uid في قاعدة البيانات الخاصة بك، والذي هو VARCHAR(50).

في فئة BookingTb الخاصة بك، تأكد من أن خاصية Uid معرفة كنص، مثل هذا:

csharp
public class BookingTb { // خصائص أخرى... public string Uid { get; set; } // خصائص أخرى... }

بهذا التغيير، يمكنك تعيين المتغير user مباشرة إلى خاصية Uid دون أي تحويل:

csharp
b.Uid = user;

هذا يجب أن يحل المشكلة، ويجب أن يعمل الكود بشكل صحيح لتخزين Uid في جدول BookingTb.

مقالات ذات صلة

زر الذهاب إلى الأعلى
إغلاق

أنت تستخدم إضافة Adblock

يرجى تعطيل مانع الإعلانات حيث أن موقعنا غير مزعج ولا بأس من عرض الأعلانات لك فهي تعتبر كمصدر دخل لنا و دعم مقدم منك لنا لنستمر في تقديم المحتوى المناسب و المفيد لك فلا تبخل بدعمنا عزيزي الزائر