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

تحديث البيانات عبر الإنترنت

مغلق
بدأه البرنس الذهبي في 1 مايو 2005 · 5 رد · 674 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

كيف اقدر اسوي تحديث لقاعدة بيانات مربوطة بالفيجوال بيسك عن طريق الإنترنت وهل من المفترض ان

تكون قاعدة البيانات مصممة بACCESS أو SQL ارجوا التفصيل اذا وجد الحل وشكرا ؟

:o طيب لو ما ثقلت عليكم بس سؤال بسيط عن الــSQL يعني نزلت البرنامج بس عرفت انه في برنامج ثاني مخصص لأنشاء الجداول فين الأقي هذا البرنامج وشكرا؟

#2

الأفضل ان تقوم ببناء برنامج للويب مثلأ ب asp.net حتى يتيح لك هذه العملية

بالنسبة للسؤال الثاني هل نزل برنامج Enterprise manage مع الSQL ام انك نزلت نسخة MSDE?

ايضا يمكنك تصميم الجداول بداخل فيجوال ستيوديو من خلال Server Explorer

لا تحزن:

إن كنت فقيرا فغيرك محبوس في دين، وإن كنت لا تملك وسيلة نقل فسواك مبتور القدمين، وان كنت تشكوا من آلام فغيرك يرقدون على الاسرة البيضاء و من سنوات، وان فقدت ولدا فغيرك فقد عددا من الأولاد و في حادث واحد.

لا تحزن:

فأنت تشرب الماء الزلال، و تستنشق الهواء الطلق، و تمشي على قدميك معافى، و تنام ليلك آمنا.

#3

شكرا اخي والإصدار إلي عندي MSDE وشكرا جزيلا اخي

#4

قبل يومين عملت تحديث عن طريق الأنترنت لجدول معين يعتمد على تاريخ إضافة السجل...

فأرسل التاريخ إلى صفحة asp عادية فتأتي كل البيانات التي أضيفت بعد هذا التاريخ من قاعدة البيانات التي على الأنترنت

فإذا كان هذا ما تريد فأبلغني...

#5

شكرا اخي العزيز mossa

#6

تكتب الصفحة التالية في مزود الأنترنت

صفحة ASP عادية تحتوي على كود جلب بالبيانات الجديدة

<%@ Language=VBScript %>

<%
if IsDate(Request.QueryString("Date")) then
  Set cnn = Server.CreateObject("ADODB.Connection")
  cnn.Open  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\vdb.mdb"
  
  Set rs = Server.CreateObject("ADODB.Recordset")
  rs.Open  "Select * From Vdb Where Date > #" & Request.QueryString("Date") & "#" , cnn
  
  Do until rs.EOF
	Response.Write "INSERT INTO [VDB]([CRC32], [VirusName], [Size], [Type], [Date], [Fixed]) VALUES"_
  & " ('" & rs("CRC32") & "', '" & rs("VirusName") & "', " & rs("Size") & ", '" & rs("Type") & "', #" & rs("Date") & "#, '" & rs("Fixed") & "'); " & vbNewLine
  
	rs.MoveNext
  Loop
  
  rs.Close
  cnn.Close
end if
%>

بعد ذلك يقوم البرنامج بالطلب كالتالي

المشكلة أن البرنامج مكتوب بلغة C# كالتالي

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Net;
using System.Text;

namespace Updater
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.TextBox textBox1;
  private System.Windows.Forms.ProgressBar pb;
  /// <summary>
  /// Required designer variable.
  /// </summary>
  private System.ComponentModel.Container components = null;

  public Form1()
  {
 	 //
 	 // Required for Windows Form Designer support
 	 //
 	 InitializeComponent();

 	 //
 	 // TODO: Add any constructor code after InitializeComponent call
 	 //
  }

  /// <summary>
  /// Clean up any resources being used.
  /// </summary>
  protected override void Dispose( bool disposing )
  {
 	 if( disposing )
 	 {
    if (components != null) 
    {
   	 components.Dispose();
    }
 	 }
 	 base.Dispose( disposing );
  }

  #region Windows Form Designer generated code
  /// <summary>
  /// Required method for Designer support - do not modify
  /// the contents of this method with the code editor.
  /// </summary>
  private void InitializeComponent()
  {
 	 this.button1 = new System.Windows.Forms.Button();
 	 this.textBox1 = new System.Windows.Forms.TextBox();
 	 this.pb = new System.Windows.Forms.ProgressBar();
 	 this.SuspendLayout();
 	 // 
 	 // button1
 	 // 
 	 this.button1.Location = new System.Drawing.Point(32, 8);
 	 this.button1.Name = "button1";
 	 this.button1.TabIndex = 0;
 	 this.button1.Text = "button1";
 	 this.button1.Click += new System.EventHandler(this.button1_Click);
 	 // 
 	 // textBox1
 	 // 
 	 this.textBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
 	 this.textBox1.Location = new System.Drawing.Point(0, 38);
 	 this.textBox1.Multiline = true;
 	 this.textBox1.Name = "textBox1";
 	 this.textBox1.Size = new System.Drawing.Size(696, 448);
 	 this.textBox1.TabIndex = 1;
 	 this.textBox1.Text = "";
 	 // 
 	 // pb
 	 // 
 	 this.pb.Location = new System.Drawing.Point(120, 8);
 	 this.pb.Name = "pb";
 	 this.pb.Size = new System.Drawing.Size(512, 24);
 	 this.pb.TabIndex = 2;
 	 // 
 	 // Form1
 	 // 
 	 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
 	 this.ClientSize = new System.Drawing.Size(696, 486);
 	 this.Controls.Add(this.pb);
 	 this.Controls.Add(this.textBox1);
 	 this.Controls.Add(this.button1);
 	 this.Name = "Form1";
 	 this.Text = "Form1";
 	 this.ResumeLayout(false);

  }
  #endregion

  /// <summary>
  /// The main entry point for the application.
  /// </summary>
  [STAThread]
  static void Main() 
  {
 	 Application.Run(new Form1());
  }

  private void button1_Click(object sender, System.EventArgs e)
  {
 	 byte[] x = new byte[1024];
 	 //MessageBox.Show(this, DateTime.Today.ToShortDateString());
 	 HttpWebRequest hq = (HttpWebRequest)HttpWebRequest.Create("http://localhost/AntiVirus/asppage1.asp?date=1/9/2000"); // أو عنوان صفحتك في الأنترنت
 	 HttpWebResponse hp = (HttpWebResponse) hq.GetResponse();
 	 Stream s = hp.GetResponseStream();
 	 int len;
 	 pb.Maximum = (int)hp.ContentLength;
 	 textBox1.Text = "";
 	 while ( (len = s.Read(x, 0, 1024)) > 0)
 	 {
    Application.DoEvents();
    pb.Value += len;
    string str = Encoding.ASCII.GetString(x, 0 , len);
    textBox1.Text += str;
 	 }
 	 

  }
	}
}

وشكراً

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

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