עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

בעיה ב-Database באתר

Featured Replies

פורסם

שלום אני מנסה לבנות Database לאתר שלי.

הכנסתי את כל מה שצריך אבל כשאני מריץ את האתר באקפלורר ומנסה להירשם הוא רושם לי שיש לו בעיה כי הקובץ כבר נמצא בשימוש.

(סימנתי בכוכביות בקוד את השורה שהוא מדבר עליה).

(זה הקוד של הדף צד שרת כמובן).


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OleDb;

public partial class Join : System.Web.UI.Page
{
public string date, news;
public string user_name, user_password, user_email, user_gender;
public string regStatus = "0";
protected void Page_Load(object sender, EventArgs e)
{
date = (DateTime.Now.ToShortDateString());
if (Request.Form["submit"] != null)
{
user_name = (Request.Form["user_name"]);
user_password = (Request.Form["user_password"]);
user_email = (Request.Form["user_email"]);
user_gender = (Request.Form["user_gender"]);
string sql = "INSERT INTO Datebase (user_name, user_password, user_email, user_gender) VALUES ('";
sql += user_name + "' , '" + user_password + "', '" + user_email + "', '" + user_gender + "')";
string Path = Server.MapPath("App_Data/Database.mdf");
string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + Path;
OleDbConnection conn = new OleDbConnection(connStr);
string tableName = "Users";
string selectQuery = "SELECT * FROM " + tableName;
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(selectQuery, conn);
da.Fill(ds, tableName); *********************************
DataTable table = ds.Tables[tableName];
DataRow row = table.NewRow();
row["user_name"] = user_name;
row["user_password"] = user_password;
row["user_email"] = user_email;
row["user_gender"] = user_gender;
table.Rows.Add(row);
OleDbCommandBuilder cmdBuilder = new OleDbCommandBuilder(da);
da.Update(ds, tableName);
conn.Open();
OleDbCommand cmd = new OleDbCommand(sql, conn);
cmd.ExecuteNonQuery();
conn.Close();
regStatus = "ההרשמה בוצעה בהצלחה";
}
}
}[/left]

פורסם

שלום וברוך הבא לפורום!

ערוך בבקשה את ההודעה ועטוף את הקוד שלך בטג קוד (כפתור # שליד כפתור הציטוט) כדי שייראה נורמלי.

חוץ מזה לא סימנת שום שורה באדום...

פורסם
  • מחבר

ערכתי וסימנתי בכוכביות

השורה היא

da.Fill(ds, tableName);

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.