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

ضروري .. خطوة وقفتني اثناء عملي (ربط قاعدة البيانات)

مغلق
بدأه عــــــمـــــاد في 9 مايو 2003 · 3 رد · 675 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

ضروري وعاااجل جداً .. جزاكم الله خيراً

عندي استفسار عن خطوة في عمل البرنامج

برنامجي فكرتة (عرض جداول بشكل عادي جداً )

اريد ان اعرف كيف اقوم بعرض جدول تم تصميمة بالاكسيس في لغة الفيجوال سي++

بمعنى اني اريد شرح هذة الطريقة ..

اذا استخدمت اداة Gride لعرض الجدول

كيف لي ان اربطها في الداتا بيز وماهو الكود اللازم

شرح اوضع ( عند النقر على امر"جدول الطلاب" من قائمة"عرض" مثلاََ ---> مباشرة يظهر لي جدول الطلاب في الشاشة الرئيسية للبرنامج )

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

اريد جزاكم الله خيراً توضيح لكيفية عمل هذة الخطوة

تحياتي لكم

#2
read the data from database and save it in an Array for examble( dataBaseArray) , than write or( save )this data in Grid. 
for example write tow Methods initTable(); and setDatatIntable with this Algorithm.
2. call the method initTable in f.EX. OnInitDialog();
3.call the Method setDatainTable, if you have the data from DB

for init the table write a methode for Ex.

void  initTable(CArray *Titles)
{
int colsCount=Titles->GetSize();
m_Table->SetCols(colsCount);
m_Table->SetRows(2);
m_Table->SetRow(0);

CString str;
for(int i=;i{
      m_Table->SetCol(i);
      str=(CString)Titles->GetAt(i);
     m_Table->SetText(str);
}

}//initTable

//for setting the data in Table
void setDataInTable(CArray *db_array)
{
int rowsCount=db_Array->GetSize();
m_Table->SetRows(rowsCount+1);
CArray *myrow=(Array*)db_Array->GetAt(0);
int colscount=myrow->GetSize();

m_Table->Clear();//m_table is the variable, whitch connectedwith Grid
CString myvalue;
for(int i=0;i {
    m_Table->SetRow(i+1);
    myrow=(Array*)db_Array->GetAt(i);
   for(int j=0;j    {
              m_Table->SetCol(j);
              myvalue=(CString)myrow->GetAt(j);

              m_Table->SetText(myvalue);
    }//for j


}//for i
}//setdata
اللهم انا نسألك علما نافعا ونعوذ بك من حماقة الجهلاء
#3

ياليت توضيح اكثر

لاني مبتدئ اكون شاكر

#4
we need tow methods for viewing data in Tabel;

the 1 st method is for init the table, in this Method well define  the names of colums

void  initTable(CArray *Titles)//the Titels for this Table
{
int colsCount=Titles->GetSize(); 
m_Table->SetCols(colsCount);//for how many Cols has the Table
m_Table->SetRows(2); //for init we nead tow rows one for the Titels and the 2 nd is empty  

m_Table->SetRow(0);//the positition is the 1. st Row for titles

CString str;
for(int i=;i{
      m_Table->SetCol(i);//the position in colum 1,2,3,...
      str=(CString)Titles->GetAt(i);//read the titel from Array
     m_Table->SetText(str);//put the  new title in row[0] and  col 
}

}//initTable

the 2 nd Method is for full the table with data

void setDataInTable(CArray *db_array)
{
/* db_arry is Array from Array from String as Matrix */
int rowsCount=db_Array->GetSize();// for the count of rows
m_Table->SetRows(rowsCount+1);//Rows are more on for The Titles
CArray *myrow=(Array*)db_Array->GetAt(0);
int colscount=myrow->GetSize();

m_Table->Clear();//clear the table from data
CString myvalue;
for(int i=0;i {
    m_Table->SetRow(i+1);//the row positin, we beginn with 1 becuse the 0 position is for Title 
    myrow=(Array*)db_Array->GetAt(i);//read Row 
   for(int j=0;j    {
              m_Table->SetCol(j);//the col position 
              myvalue=(CString)myrow->GetAt(j);

              m_Table->SetText(myvalue);//set data in the row[i+1]cols[j]
    }//for j


}//for i
}//setdata

Excuse me; I havent Arabic System
if you dom't understand than send me e-mail with your ID in Yahoo and I have to Ansewr you with yahoo-Messanger
اللهم انا نسألك علما نافعا ونعوذ بك من حماقة الجهلاء

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

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

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

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

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

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