0
我設計我的網頁和圖像存儲在我的數據庫錯誤(該項目是PhotoStudio中管理系統)Asp.net如何糾正
我的代碼:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
namespace photoshops
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlDataAdapter da = new SqlDataAdapter();
SqlConnection cnn = new SqlConnection();
DataSet ds = new DataSet();
string constr = null;
SqlCommand cmd = new SqlCommand();
if (IsValid != true)
{
constr = @"Data Source=DEVI\SQLEXPRESS;Initial Catalog =cat; Integrated
Security=SSPI";
cnn.ConnectionString = constr;
try
{
if (cnn.State != ConnectionState.Open)
cnn.Open();
}
catch (Exception ex)
{
string str1 = null;
str1 = ex.ToString();
}
cmd.Connection = cnn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "photoset";
cmd.Parameters.Clear();
cmd.Parameters.AddWithValue("@BillNo", TextBox1.Text);
cmd.Parameters.AddWithValue("@CustomerName", TextBox2.Text);
cmd.Parameters.AddWithValue("@Address", TextBox3.Text);
cmd.Parameters.AddWithValue("@StartDate",Rdbsdate.SelectedDate);
cmd.Parameters.AddWithValue("@EndDate", Rdbddate.SelectedDate);
SqlParameter param0 = new SqlParameter("@Systemurl", SqlDbType.VarChar,
50);
cmd.Parameters.AddWithValue("@Numberofcopies", TextBox7.Text);
cmd.Parameters.AddWithValue("@Amount", TextBox8.Text);
cmd.Parameters.AddWithValue("@Total", TextBox9.Text);
da.SelectCommand = cmd;
try
{
da.Fill(ds);
}
catch (Exception ex)
{
string strErrMsg = ex.Message;
//throw new applicationException("!!!! An error an occured while
//inserting record."+ex.Message)
}
finally
{
da.Dispose();
cmd.Dispose();
cnn.Close();
cnn.Dispose();
}
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
Msg.Text = "Photo setting sucessfullY";
}
else
{
Msg.Text = "photosetting failled";
}
}
}
}
}
}
我的錯誤 記錄不存儲,圖像不存儲如何更改我的代碼。
通過所有意味着要求幫助,但請不要說像*發送給我的代碼* - 這被認爲是粗魯的。 – slugster 2011-03-31 06:17:14
是的。請注意堆棧溢出時重點放在**問題**上。你在尋求幫助,而不是要求。 – 2011-03-31 06:21:02
@Tieson T對不起我的錯誤 – vimal 2011-03-31 06:45:41