bunyamin
Posts: 2
|
Posted: 07/13/2006, 3:55 AM |
|
Hi,
i have below errors when i publish project on c#, Sql200. Please help me somebody knows this solve
d:\Documents and Settings\bunyas\Local Settings\Temp\~NewProject2\components\Settings.cs(112,9): warning CS1522: Empty switch block
Error:d:\Documents and Settings\bunyas\Local Settings\Temp\~NewProject2\NewPage1.aspx.cs(71,4): error CS0104: 'SqlCommand' is an ambiguous reference
-----------------------------------------------------------------------------
My codes;
//Using Statements @1-B76C8377
using System;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Diagnostics;
using System.Web;
using System.IO;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;
using System.Text.RegularExpressions;
using System.Globalization;
using NewProject2;
using NewProject2.Data;
using NewProject2.Configuration;
using NewProject2.Security;
using NewProject2.Controls;
// Create connection
SqlConnection conn = new SqlConnection("server=85.85.85.85;uid=sen;password=sen326;database=sen");
// Create Adapter
SqlDataAdapter dbAdapt = new SqlDataAdapter("SELECT * FROM daire", conn);
// Create and initialize CommandBuilder
SqlCommand dbCB = new SqlCommand(dbAdapt);
conn.Open();
// New DataSet
DataSet dbSet = new DataSet();
// Populate DataSet with data
dbAdapt.Fill(dbSet, "daire");
// Get reference to our table
DataTable dbTable = dbSet.Tables["daire"];
// Create new row
DataRow dbRow = dbSet.Tables["daire"].Rows[0];
// Store data in the row
dbRow["FileName"] =strName;
dbRow["FileSize"] = Buffer.Length;
dbRow["ContentType"] = strType;
dbRow["FileData"] = Buffer;
// Update data source
// dbAdapt.UpdateCommand=new OleDbCommand(db ,conn);
dbAdapt.UpdateCommand.Parameters.Add("@prmname",dbRow["FileName"]);
dbAdapt.UpdateCommand.Parameters.Add("@prmsize",dbRow["FileSize"]);
dbAdapt.UpdateCommand.Parameters.Add("@prmcontent",dbRow["ContentType"]);
dbAdapt.UpdateCommand.Parameters.Add("@prmdata",dbRow["FileData"]);
dbAdapt.Update(dbSet, "daire");
// Close connection
conn.Close();
|
|
|
Stan
|
Posted: 07/13/2006, 5:04 AM |
|
Try to use the full name for SqlCommand, i.e.
System.Data.SqlClient.SqlCommand
|
|
|
|