为什么更新不了数据库呢??(急) [问题点数:100分,结帖人gly007]

Bbs1
本版专家分:0
结帖率 100%
Bbs1
本版专家分:0
Bbs1
本版专家分:0
为什么更新不了数据库
string updata="UPDATE Table1 SET 第一场 = '4:3' WHERE 用户名 = 'aaa'";rn SqlCommand com1 = new SqlCommand(updata,sqlcon); com1.ExecuteNonQuery();rn不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符。rn这是为什么?
怎么更新不了数据库呢?
int cr_resultrn//计算记录个数rnselect count(*) into :amount from LOGIN;rn//建立游标rndeclare cr_loginname cursor for select LOGINNAME from LOGIN;rnif sle_user.text="" thenrn messagebox("提醒!","用户名不能为空!")rnelsern //打开游标rn open cr_loginname;rn do while amount>0 rn fetch cr_loginname into :usedname;rn if usedname=sle_user.text thenrn exitrn end ifrn amount --rn looprn if amount<>0 thenrn messagebox("错误!","该用户名己经存在,请输入新的用户名!")rn elseif sle_password.text<>sle_check.text thenrn messagebox("错误!","用户密码与确认密码不致,请重新输入!")rn else rn cr_result=messagebox("提醒!","请确认~n"+"用户名:"+sle_user.text+"~n"+"密码:"+sle_password.text,Question!,YesNo!)rn if cr_result=1 thenrn //把数据插入<em>数据库</em>rn insert into LOGIN values(:sle_user.text,:sle_password.text);rn commit;rn messagebox("success!","用户注册成功!")rn sle_user.text=''rn sle_password.text=''rn sle_check.text=''rn end ifrn end ifrn //关闭游标,释放资源rn close cr_loginname;rn end ifrn这是一段创建新用户的代码,可是就是<em>更新</em><em>不了</em><em>数据库</em>!rn高手指点一下问题出在那里了??
为什么更新不了我的数据库
dw_1.accepttext()rnrnif isnull(dw_1.getitemstring(1,'c_name')) then rn messagebox('警告','书名不能为空')rn dw_1.setfocus()rn dw_1.setcolumn('c_name')rn returnrnend ifrnrnrnif isnull(dw_1.getitemstring(1,'c_writer')) then rn messagebox('警告','作者')rn dw_1.setfocus()rn dw_1.setcolumn('c_writer')rn returnrnend ifrnrnif isnull(dw_1.getitemstring(1,'c_publisher')) then rn messagebox('警告','出版社')rn dw_1.setfocus()rn dw_1.setcolumn('c_publisher')rn returnrnend ifrnlong irninteger pricernstring id ,name,writer,publisherrnid=dw_1.getitemstring(1,'c_id')rnname=dw_1.getitemstring(1,'c_name')rnprice=dw_1.getitemnumber(1,'f_price')rnwriter=dw_1.getitemstring(1,'c_writer')rnpublisher=dw_1.getitemstring(1,'c_publisher')rnrnrnif dw_1.update()=1 then rn commit;rn messagebox('恭喜','资料已经保存')rn insert into t_books values(:id,:name,:price,:writer,:publisher,1)rn commit;rnelse rn rollback;rn messagebox('错误','资料保存失败')rnend ifrn
help为什么更新不了数据库
当读取<em>数据库</em>时候,复选框没有打勾的,我打上勾,点提交,<em>数据库</em>就打上勾.(正确)rn当读取<em>数据库</em>时候,复选框有打勾的,我取消它,点提交,<em>数据库</em>还是没有被取消掉。(错误)代码如下:rnrnprorem.asp:rnrnrnrn rn rn 是否推荐:rn ">rn rn rn rn checked>rn rn rn rn rn rn rn rnprorem1.asprnrnrnrnrnrn
啊!!为什么数据库不能更新了呢?
我的<em>数据库</em>用的好好的,但是最近却不能<em>更新</em>了,为什么呢?
()为什么显示不了呢?
rn rn 无标题文档rnrnrnrn rn rn rn 今天是:rn rn 我们离开学校已经有∶rn rn rn rn rn rn rnrnrnrn
为什么关闭不了数据库呢?
string conStr=System.Configuration.ConfigurationSettings.AppSettings["Access"];rn OleDbConnection con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+System.Web.HttpContext.Current.Server.MapPath(conStr));rn con.Open(); rn OleDbCommand cmd=new OleDbCommand("select count(*) from admin where userName='"+userName+"' and userPassWord='"+userPassWord+"'",con);rn int count=(int)cmd.ExecuteScalar();rn if(count>0)rn rn return "YES";rn rn elsern rn return "NO";rn rn con.Close();rnrnrnrnrn这里我的代码,后面一行con.Close();提示检测到无法访问的代码,请问怎么回事呢
为什么rs更新不了数据?!!!!
[code=VBScript]rnrnrnrn[/code]rn上面通过response.write passNew是能打印出来数据的,rn而且"select * from user where username='"&userNew & "'"在<em>数据库</em>中也有那条数据的rn就是<em>更新</em><em>不了</em>?<em>急</em>求帮助!rn[code=VBScript]rnrs1.open "select * from user where username='"&userNew & "'" ,conn,1,2rn或rnrs1.open "select * from user where username='"&userNew & "'" ,conn,3,3rn都不能<em>更新</em>,郁闷了rn[/code]
为什么恢复不了数据库??!!!!
我们公司的<em>数据库</em>服务器换了,我把旧服务器上的<em>数据库</em>文件:business_Data.MDF和business_Data1_Data.NDFrn、business_Data2_Data.NDF、business_Data3_Data.NDF、business_Data4_Data.NDF添加到设备,然后点“选项”恢复的时候报错:business_Data4_Data.NDF不是有效的SQLSERVER 数据文件,恢复<em>不了</em>rn怎么会事啊??rn那台旧机器最开始装的2000,后来装成XP后才把几个文件COPY到新服务器上的,新服务器也是2000,与这个有关吗???rn帮帮忙啊,非常<em>急</em>!!!!!!
备注字段为什么更新不了呢?
access表里有个备注字段:rnmyStr="一大段文字......................................................................."rnCurrentDb.Execute "UPDATE 订单状态查询表 SET 订单状态查询表.备注 =1111111"就可以,就是说是数字就可以rn而CurrentDb.Execute "UPDATE 订单状态查询表 SET 订单状态查询表.备注 =" & myStr 或者rnCurrentDb.Execute "UPDATE 订单状态查询表 SET 订单状态查询表.备注 ='" & myStr &"'"rnrn都通不过,不知道为什么!rnrn请教:如何<em>更新</em>备注字段呢?rnrn最好给个列子谢谢!
为什么我更新保存不了数据呢.
'保存<em>更新</em>。rn Dim num As Integerrn '停止当前的任务编辑rn Me.BindingContext(Dataset1, "table1").EndCurrentEdit()rn '获取dataset 中更改的内容rn Dim chgobj As New DataTablern chgobj = CType(Dataset1.Tables("table1").GetChanges, DataTable)rn If Not chgobj Is Nothing Thenrn If Sqldbconn1.State = 0 Then Sqldbconn1.Open()rn Sqladapter1.ContinueUpdateOnError = Truern Tryrn num = Sqladapter1.Update(chgobj)rn Dataset1.Merge(chgobj)rn Dataset1.AcceptChanges()rn Catch ex As Exceptionrn System.Windows.Forms.MessageBox.Show(ex.Message)rn End Tryrn Sqldbconn1.Close()rn End Ifrn
为什么我更新不了数据库呢???请高手指点啦。。。
为什么我<em>更新</em><em>不了</em><em>数据库</em>呢???请高手指点啦。。。rnSqlDataAdapter myAdapter=new SqlDataAdapter("select * from touch",myConnection);rnrnSqlCommandBuilder myBuilder=new SqlCommandBuilder(myAdapter);rnrn DataSet ds=new DataSet();rnrn myAdapter.Fill(ds,"touch");rn rn ds.Tables["touch"].Rows[1]["name"]=name;rn rn myAdapter.Update(ds,"touch");rn rnrn
为什么更新不了数据库阿?!在线等!
小弟用ODBC连接access<em>数据库</em>,代码如下:rn //创建CUserRcordSet的实例rn CUserRecordSet m_UserRecordSet;rnrn tryrn rn if (m_UserRecordSet.IsOpen())rn m_UserRecordSet.Close();rn rn //设置查询条件"UserName=ClientName"rn m_UserRecordSet.m_strFilter.Format("UserName = '%s' ", clientName);rn m_UserRecordSet.Open(CRecordset::snapshot,NULL,CRecordset::none);rn //输出匹配上查询条件用户记录,如果记录为空则返回rn if (m_UserRecordSet.IsOpen() && !m_UserRecordSet.IsEOF())rn rn //设置编辑当前记录rn m_UserRecordSet.Edit();rn if (clientStatus == "1")rn rn m_UserRecordSet.m_UserStatus == "在线";rn rn else if (clientStatus == "0")rn rn m_UserRecordSet.m_UserStatus == "离线";rn rnrn m_UserRecordSet.m_UserIP = clientIP;rnrn //如果可以<em>更新</em>,则<em>更新</em>到<em>数据库</em>rn if(m_UserRecordSet.CanUpdate())rn rn m_UserRecordSet.Update(); rn rn rn //关闭记录集rn if(m_UserRecordSet.IsOpen())rn m_UserRecordSet.Close();rn每次执行到:m_UserRecordSet.Update();这一句时就报错了,错误是:<em>更新</em>或删除未涉及任何数据行。rn我在<em>数据库</em>表也查过了,的确存在我要<em>更新</em>的数据行,由于需要我要给<em>数据库</em>的user表加了几个字段,然后在VC中也<em>更新</em>了绑定的变量。那问题会出在哪里呢?搞了一上午都没找到,心情极度低落,大家给看看吧。谢谢
为什么SqlCommandBuilder更新不了数据库内容?
using System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.Data.SqlClient;rnrnnamespace AsyncDemornrn public partial class Form2 : Formrn rn private SqlDataAdapter da = null;rn private DataSet ds = null;rn public Form2()rn rn InitializeComponent();rn rnrn private void cmdSearch_Click(object sender, EventArgs e)rn rn DBBase db = new DBBase();rn da = new SqlDataAdapter("select * from testa", db.GetVisioTestDBConnection());rn ds = new DataSet();rn da.Fill(ds, "TestA");rn dataGridView1.DataSource = ds;rn dataGridView1.DataMember = "TestA";rn rnrn private void cmdUpdate_Click(object sender, EventArgs e)rn rn SqlCommandBuilder cb = new SqlCommandBuilder(da);rn tryrn rn int iis = da.Update(ds, "TestA");rn rn catch (Exception ex)rn rn MessageBox.Show(ex.ToString());rn rn rnrn private void cmdDelete_Click(object sender, EventArgs e)rn rn //dataGridView1.Rows.Remove(dataGridView1.CurrentRow);rn ds.Tables["TestA"].Rows.RemoveAt(dataGridView1.CurrentRow.Index);rn ds.Tables["TestA"].AcceptChanges();rn rn rn
为什么我的dataset 更新不了数据库内容?
下面代码是<em>更新</em><em>数据库</em>name字段的值,但是执行后<em>数据库</em>信息并没有改变,不知道错在哪里?rn(不用update 语句)rnPrivate Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Clickrn Dim da As SqlClient.SqlDataAdapterrn Dim ds As New DataSetrn Dim txtsql As Stringrn txtsql = "select * from grid where id=1"rn da = New SqlClient.SqlDataAdapter(txtsql, cn)rn da.Fill(ds, "grid")rn ds.Tables("grid").Rows(0)("name") = "abce"rn ds.Tables("grid").Rows(0).AcceptChanges()rn da.Update(ds, "grid")rn End Subrn
为什么更新不了?DataAdapter.
在网页里有TextBox,绑定到数据集dataSet11。rn然后用oleDbDataAdapter1.Fill(dataSet11);rnrn修改数据后,直接用rnoleDbConnection1.Open();rnoleDbDataAdapter1.Update(dataSet11);rnoleDbConnection1.Close();rn<em>更新</em>,但是数据没任何改变.rn
为什么sqlDataAdapter.update更新不了
是控制台程序rn代码如下:rnSqlConnection connection=new SqlConnection(@"Data Source=(local);Integrated Security=SSPI;"+"Initial Catalog =NorthWind");rn connection.Open();rn rn SqlCommand cmd=new SqlCommand("select * from employees where FirstName=@FirstName",connection);rn cmd.Parameters.Add("@FirstName",SqlDbType.NVarChar,10);rn cmd.Parameters["@FirstName"].Value="Andrew";rnrn SqlDataAdapter adapter=new SqlDataAdapter();rn adapter.SelectCommand=cmd;rn DataSet dataset=new DataSet();rn adapter.Fill(dataset,"Employees");rn Console.WriteLine("name before change:0",rn dataset.Tables["Employees"].Rows[0]["FirstName"]);rnrnrn SqlCommand upcmd=new SqlCommand("Update Employees set FirstName=@FirstName where FirstName=@OldFirstName",connection);rn rn upcmd.Parameters.Add("@FirstName",SqlDbType.NVarChar,10);rn upcmd.Parameters["@FirstName"].Value="Rock";rn upcmd.Parameters.Add("@OldFirstName",SqlDbType.NVarChar,10);rn upcmd.Parameters["@OldFirstName"].Value="Andrew";rn adapter.UpdateCommand=upcmd;rn adapter.Update(dataset.Tables["Employees"]);rn rn Console.WriteLine("name after change:0",rn dataset.Tables["Employees"].Rows[0]["FirstName"]);rnrnrn connection.Close();rn
为什么更新不了数据???
我机器是XP 专业版,使用的是ASP + Access 做的,在插入数据时出现“Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC Microsoft Access Driver] 操作必须使用一个可<em>更新</em>的查询。”错误,这个是什么问题???rnrnglobal.asa文件中,<em>数据库</em>连接rnSub Application_OnStartrn Application("strConn") = "DSN=Coffee;"rnEnd Subrnrnadd.asp 文件,添加新记录rn Dim petname,review,idrn rn id = Session("ID")rn petname = request.Form("Petname")rn review = request.Form("Review")rn rn Set MyConn = Server.CreateObject("ADODB.Connection")rn MyConn.Open Application("StrConn")rn rn SQL = "Insert Into Review(ID,Petname,Review) Values(" & id & ",'" & petname & "','" & review & "')"rn MyConn.Execute(SQL)rn rn MyConn.Close
为什么更新不了
//以下执行删除操作rn OleDbConnection MyConn;rn MyConn = new OleDbConnection(ConfigurationManager.AppSettings["myconnstring"].ToString() + System.Web.HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["mydbpath"]));rn MyConn.Open();rn if (dgIDs.Length > 1)rn rn String strsql = "update Photos set IsDel=1 where Id in (" + dgIDs.Substring(0, dgIDs.LastIndexOf(",")) + ")";rn OleDbCommand myCommend = new OleDbCommand(strsql, MyConn);rn myCommend.ExecuteNonQuery();rnrn string cmdText = "SELECT * FROM Photos where IsDel=false ORDER BY Id DESC";rn OleDbDataAdapter da = new OleDbDataAdapter(cmdText, MyConn);rn DataSet ds = new DataSet();rn da.Fill(ds, "Photos");rn DataList1.DataSource = ds.Tables["Photos"].DefaultView;rn DataList1.DataBind();rnrn RecordCount.Text = ds.Tables[0].Rows.Count.ToString();rn //int from = Int32.Parse(lblCurrentpage.Text.ToString()) - 1;rnrn rn rnrn为什么我删除了也重新绑定了,页面还是会显示删除掉的数据,一定要重新刷新才消失
为什么我更新不了?!
private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)rn rn string con = ConfigurationSettings.AppSettings["SqlConnectionString"];rn SqlConnection conn = new SqlConnection(con);rn rn string UpdateCmd = "UPDATE 新闻类别 SET @新闻类别, 新闻标题 SET @新闻标题, 新闻内容 SET @新闻内容, 发布单位 SET @发布单位, 发布时间 SET @发布时间";rnrn SqlCommand myCommand = new SqlCommand(UpdateCmd,conn);rnrn myCommand.Parameters.Add(new SqlParameter("@新闻类别",SqlDbType.NVarChar,50));rn myCommand.Parameters.Add(new SqlParameter("@新闻标题",SqlDbType.NVarChar,50));rn myCommand.Parameters.Add(new SqlParameter("@新闻内容",SqlDbType.NVarChar,50));rn myCommand.Parameters.Add(new SqlParameter("@发布单位",SqlDbType.NVarChar,50));rn myCommand.Parameters.Add(new SqlParameter("@发布时间",SqlDbType.NVarChar,50));rnrn myCommand.Parameters["@新闻标题"].Value = DataGrid1.DataKeys[e.Item.ItemIndex];rnrn string[] Cols = new string[] "@新闻类别","@新闻标题","@新闻内容","@发布单位","@发布时间";rn int NumCols = e.Item.Cells.Count;rnrn for(int i = 1;i);rn rn myCommand.Connection.Close();rn DataGrid1.DataBind();rn
为什么更新不了数据
[img=https://img-bbs.csdn.net/upload/201606/01/1464788481_27843.png][/img][img=https://img-bbs.csdn.net/upload/201606/01/1464788492_641323.png][/img][img=https://img-bbs.csdn.net/upload/201606/01/1464788502_968194.png][/img][img=https://img-bbs.csdn.net/upload/201606/01/1464788512_514301.png][/img][img=https://img-bbs.csdn.net/upload/201606/01/1464788522_610668.png][/img]rnrnrn页面<em>更新</em>后会跳转到showyonghu.jsp界面,现在跳是跳的过去,可是数据没有<em>更新</em>!
为什么更新不了??
rsUser("sldisk_name")=sldisk_namernrsUser("sldisk_buyername")=sldisk_buyernamernrsUser("sldisk_type")=sldisk_typernrsUser("sldisk_subtype")=sldisk_subtypernrsUser("sldisk_keyword")=sldisk_keywordrnrsUser("sldisk_time")=sldisk_timernrsUser("sldisk_note")=sldisk_noternrsUser.updaternset rsUser=nothingrncall CloseConn() rnresponse.redirect "UserManage.asp"rn明明已经执行到了UserManage.asp 但就是无法<em>更新</em>数据。rn
为什么页面更新不了
rnrn清选择rnrnrn rnloadinfo.asprn Set conn = Server.CreateObject("ADODB.Connection")rnSet RS = Server.CreateObject("ADODB.RecordSet")rnconn.Open strConnStringrn'sql="select no, enttime, useno, funcno, formno, exittime, computer from base_syslog"rnsql="select ordertype,note from base_tabnum"rnRS.open sql,Conn,1,1rn while not RS.eofrn MemberMC=RS.fields("ordertype")rn MemberID=RS.fields("note")rn Response.Write "call window.parent.AddSelectOption(" & chr(34) & "MemberInfo" & chr(34) & "," & chr(34)& MemberMC & chr(34) & "," & chr(34) & MemberID & chr(34) & ")" & chr(13)rn RS.MoveNextrnWendrnrnrn rs.close()rn conn.close()rn set conn=nothingrn%>
为什么更新不了ADO?
俺使用ADO方式操作<em>数据库</em>两年多,最近却不断遇到新问题,而且都是基础问题,呜呼哀哉...rn俺常用的是ADO2.6组件,可是装了国土资源部一个程序后(http://www.landstar.com.cn/)\下载专区\变更汇总2003,竟然出现无法创建ActiveX部件的提示,经分析,该程序安装了ADO2.1部件,并影响到ADO2.6的使用,但现在无论如何都无法解决该问题,包括卸载该程序并重新安装Mdac_typ27或Mdac_typ28,重装系统是不可能的,因为有一百多用户,请大家踊跃参与。
为什么更新不了数据!!!
用的DATAGRID的edititemtemplate功能,SQL语句都没有问题,不过传回去的数据根本没有<em>更新</em>(我测试的时候干脆吧<em>更新</em>后的数据Response.Write出来,却发现传回去还是以前的数据~~~~~~~~~~~恼火啊~~~明明修改了TextBox的………………,而且以前<em>更新</em>都不会有问题的,这下没法了
datagrid居然更新不了数据库~~!!!
private void grdMenu_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)rn rn cn=new SqlConnection(strConn);rn cn.Open();rn string strSql="update menu set menuname=@menuname,bigtype=@bigtype,smalltype=@smalltype where id=@ID";rn SqlCommand cm=new SqlCommand(strSql,cn);rnrn cm.Parameters.Add(new SqlParameter("@menuname",SqlDbType.NVarChar,14));rn cm.Parameters.Add(new SqlParameter("@bigtype",SqlDbType.NVarChar,2));rn cm.Parameters.Add(new SqlParameter("@smalltype",SqlDbType.NVarChar,2));rn cm.Parameters.Add(new SqlParameter("@ID",SqlDbType.Int,4));rnrn cm.Parameters["@menuname"].Value=((TextBox)e.Item.FindControl("menuname")).Text.ToString();rn cm.Parameters["@bigtype"].Value=((TextBox)e.Item.FindControl("bigtype")).Text.ToString();rn cm.Parameters["@smalltype"].Value=((TextBox)e.Item.FindControl("smalltype")).Text.ToString();rnrn cm.Parameters["@ID"].Value=grdMenu.DataKeys[(int)e.Item.ItemIndex];rnrn //cm.Connection.Open();rnrn tryrn rn rn cm.ExecuteNonQuery();rn grdMenu.EditItemIndex=-1;rn rn catch(SqlException)rn rn rn //cm.Connection.Close();rn cn.Close();rn BindData();rnrnrnrnrn每次编辑<em>更新</em>后得到的是空值,在编辑框输入的内容反而不能<em>更新</em>到<em>数据库</em>。rnrn是什么原因?<em>急</em>!
,为何更新不了数据库
想把Access的<em>数据库</em>的数据先取出来,然后用记录中的某几个字段值进行运算后<em>更新</em>改记录中的另外两个字段值,不知道为什么,用了DataRow进行<em>更新</em>,结果RowState返回来的值都是Unchanged,然后调试,发现Table里要<em>更新</em>的每条记录的字段值都已经是被修改了后的数据,但是最后在Dataset.Update后结果数据还是没有<em>更新</em>,这是为什么,以下是代码,rn rn string strYear=(string)Session["SelYear"];rn //create the db connection and command objectsrn string strCon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ Server.MapPath("Data") +"\\Test.MDB;";rn string strTable="Test"+strYear;rn string strGetSql="select sewage,population from " + strTable + " order by id";rn string strSetSql="select COD1000,TN1000,TP1000,sewage,population,workid from " + strTable ; rn OleDbConnection oleCon=new OleDbConnection(strCon);rn oleCon.Open();rn //***********************************rn /rn //get the parameters about sewage and populationrn OleDbDataAdapter oleDBAD=new OleDbDataAdapter();rn oleDBAD.SelectCommand =new OleDbCommand(strSetSql,oleCon);rn OleDbCommandBuilder custCB = new OleDbCommandBuilder(oleDBAD);rnrn DataSet ds=new DataSet();rn oleDBAD.Fill(ds);rnrn DataTable dt=ds.Tables[0]; rn rn double dbSewage=0;rn double dbPop=0;rn double dbLifeCOD=0;rn double dbLifeTN=0;rn double dbLifeTP=0;rn int i=0;rn int nWorkID=0;rn int nAllCount=dt.Rows.Count;rn if(dt!=null)rn rn rn for(i=0;i
DataList更新不了!!!!!!!!
asp.net DataList <em>更新</em><em>不了</em>,取不出控件输入的值rn[code=C#]rn if (e.CommandName == "Update")rn rn string name = ((TextBox)e.Item.FindControl("txtNameE")).Text; rn Bind();rn Response.Write(" ");rn rn[/code]rntxtNameE控件绑定了字段, 现在需要<em>更新</em>数据,不过怎么<em>更新</em>都是原来绑定的字段,文本框输入的值没有传进去
ds.update更新不了数据库
dim actionrnaction=request.QueryString("action")rnif action="save" thenrnset rs=server.CreateObject("adodb.recordset")rnrs.Open "select webname,musicd,musicurl,webemail,dizhi,youbian,guestuser,pictype,ordermail,regmail,qqwz,bbslogo,dymail,xwtype,dianhua,sltype,probg,des,key,copyright,weblogo,weburl,webbanner,icp,qq,mailaddress,mailsend,mailusername,mailname,mailuserpass,view,webnow,webmess,ksu,csu,xinpin,tuijian,tejia from webinfo ",conn,1,3rnrs("webname")=trim(request("webname"))rnrs("webemail")=trim(request("webemail"))rnrs("dizhi")=trim(request("dizhi"))rnrs("youbian")=trim(request("youbian"))rnrs("dianhua")=trim(request("dianhua"))rnrs("copyright")=trim(request("copyright"))rnrs("webbanner")=trim(request("webbanner"))rnrs("weblogo")=trim(request("weblogo"))rnrs("webbanner")=trim(request("webbanner"))rnrs("guestuser")=trim(request("guestuser"))rnrs("weburl")=trim(request("weburl"))rnrs("icp")=trim(request("icp"))rnrs("qq")=trim(request("qq"))rnrs("view")=trim(request("view"))rnrs("des")=trim(request("des"))rnrs("key")=trim(request("key"))rnrs("sltype")=trim(request("sltype"))rnrs("mailaddress")=trim(request("mailaddress"))rnrs("mailsend")=trim(request("mailsend"))rnrs("mailusername")=trim(request("mailusername"))rnrs("mailuserpass")=trim(request("mailuserpass"))rnrs("mailname")=trim(request("mailname"))rnrs("webnow")=trim(request("webnow"))rnrs("xwtype")=trim(request("xwtype"))rnrs("webmess")=trim(request("webmess"))rnrs("ksu")=trim(request("ksu"))rnrs("csu")=trim(request("csu"))rnrs("xinpin")=trim(request("xinpin"))rnrs("tejia")=trim(request("tejia"))rnrs("tuijian")=trim(request("tuijian"))rnrs("probg")=trim(request("probg"))rnrs("qqwz")=trim(request("qqwz"))rnrs("dymail")=trim(request("dymail"))rnrs("bbslogo")=trim(request("bbslogo"))rnrs("pictype")=trim(request("pictype"))rnrs("ordermail")=trim(request("ordermail"))rnrs("regmail")=trim(request("regmail"))rnrs.updaternrs.closernset rs=nothingrnresponse.Write " "rnend if%>
数据库记录更新不了
ASP程序,用来统计站点访问页面,每个商家有个单独的ID(VisSmemberid )作为主键rn用下面程序判断,思路是这样,如果<em>数据库</em>表里没有这个商家的记录就添加一个商家记录,rnsitememberid这个是作为会话调用判断商家ID的rnrnprotype,shopstype ,bustype,这个几个表示商家页面主页面,产品页面,和购买页面rnrn如果已经包含这个商家记录的话,在这条记录上<em>更新</em>,但是测试过后,添加可以,但是<em>更新</em>记录通不过rn,测试将else下面的语句放到判断的上半部分的时候,可以添加没有的记录,也可以<em>更新</em>,但是只能更rn新<em>数据库</em>表里的第一条记录,其他记录<em>更新</em><em>不了</em>。rnrnrnrnrnrnrn<> sitememberid then rnrncountrs.addnew rncountrs("VisSmemberid")=sitememberidrnif session("fortunememberid") <> ""thenrn countrs("VisFmemberid")=session("fortunememberid")rn countrs("VisType")=1 '0匿名 1会员rnelsern countrs("VisType")=0rnend ifrnif bustype = 1 thenrn countrs("VisBus")=1rnend ifrnif protype = 1 thenrn countrs("VisPro")=1rnend if rnif shopstype = 1 thenrn countrs("VisShops")=1rnend ifrnrnelse rnrnif session("fortunememberid") <> ""thenrn countrs("VisFmemberid")=session("fortunememberid")rn countrs("VisType")=1 '0匿名 1会员rnelsern countrs("VisType")=0rnend ifrnif bustype = 1 thenrncountrs.open "select * from [Visitz] where VisSmemberid="&request("sitememberid"),conn,1,3 rncountrs("VisBus")=rs("VisBus")+1 rnrncountrs.update rnrn 'countrs("VisBus")=1rnend ifrnif protype = 1 thenrncountrs.open "select * from [Visitz] where VisSmemberid="&request("sitememberid"),conn,1,3 rncountrs("VisPro")=rs("VisPro")+1 rnrncountrs.update rn 'countrs("VisPro")=1rnend if rnif shopstype = 1 thenrnrncountrs.open "select * from [Visitz] where VisSmemberid="&request("sitememberid"),conn,1,3 rncountrs("VisShops")=rs("VisShops")+1 rnrncountrs.update rn 'countrs("VisShops")=1rnend ifrnrnend if rnrnrncountrs("VisIP")=request.ServerVariables("REMOTE_ADDR")rncountrs("VisDate")=date()rncountrs.updaterncountrs.closernset countrs = nothingrn%>
怎么更新不了数据库
代码如下:rn private void btnReturn_Click(object sender, EventArgs e)rn rn DataSet ds = new DataSet();rn string strsql = "select * from BorrowBook";rn SqlDataAdapter da = new SqlDataAdapter(strsql,this.sqlConnection1);rn da.Fill(ds, "还书表");rn SqlCommandBuilder sqlcdb = new SqlCommandBuilder(da);rn ds.Tables["还书表"].PrimaryKey = new DataColumn[] ds.Tables["还书表"].Columns["ID"] ;rn for (int i = 0; i < ds.Tables["还书表"].Rows.Count; i++)rn rn if (ds.Tables["还书表"].Rows[i]["ReaderID"].ToString() == this.textReaderID.Text && ds.Tables["还书表"].Rows[i]["BookID"].ToString() == this.textBookID.Text)rn rn int dday = System.DateTime.Today.DayOfYear - ((System.DateTime)ds.Tables["还书表"].Rows[i]["ReturnDate"]).DayOfYear;rn ds.Tables["还书表"].Rows[i]["FactReturnDate"] = System.DateTime.Today;rn da.Update(ds,"还书表");rn ds.AcceptChanges();rn if (dday > 0)rn rn MessageBox.Show(this.textInformation.Text = this.textReaderID.Text + "读者你的" + this.textBookID.Text + "图书已经过期" + Convert.ToString(dday)rn + "天,罚款" + Convert.ToString(dday / 10) + "元RMB", "过期", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);rn rn rn rn rn ReturnBook(this.textBookID.Text);rn ReturnReader(this.textReaderID.Text);rn this.textInformation.Text = this.textReaderID.Text + "归还图书" + this.textBookID.Text + "成功";rn rnrn以上代码是想实现<em>更新</em>数据表“BorrowBook”中的FactReturnDate字段,通过“ds.Tables["还书表"].Rows[i]["FactReturnDate"] = System.DateTime.Today;”来获取系统时间,但是通过以上这个函数却<em>更新</em><em>不了</em>,不知道哪里出错了?
Data.OleDb.OleDbDataAdapter 更新 不了数据库
Dim sqlcommand As Data.OleDb.OleDbDataAdapterrn sqlconnclient = New OleDb.OleDbConnection(sqlstr)rn sqlcommand.Fill(rs)rn rs.Tables(0).Rows(0).Item("title") = "abc"rn sqlconn.Close()rnrn sqlcommand.Update(rs)rn能<em>更新</em>到<em>数据库</em>吗?
为什么窗口切换不了呢?。。。。
程序的功能是打开4个ie,通过按钮1切换到ie1,按钮2切换到ie2。。。。rnrn1。打开ie1。 rnie2,ie3,ie4,用同样方法打开rnrnvoid CIEChange1Dlg::OnOpenIE() rnrn STARTUPINFO s1;rn ZeroMemory( &s1, sizeof(s1) );rn s1.cb = sizeof(s1);rn ZeroMemory( &p1, sizeof(p1) );rn CreateProcess( NULL, "C:\\Program Files\\Internet Explorer\\IEXPLORE.exe", NULL,NULL, FALSE, 0, NULL, NULL, &s1, &p1);rnrnrn2。遍历所有的窗口rnrnBOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)rnrn DWORD dwpid;rn GetWindowThreadProcessId(hwnd, &dwpid);rn LPPROCESS_INFORMATION pInfo = (LPPROCESS_INFORMATION)lParam;rn if(dwpid == pInfo->dwProcessId)rn rn pInfo->hProcess = hwnd;rn return FALSE;rn rn return TRUE;rnrn3。返回窗口句柄rnHWND GetProcessMainWnd(DWORD dwpid)rnrn PROCESS_INFORMATION wi;rn wi.dwProcessId = dwpid;rn wi.hProcess = NULL;rnrn EnumWindows(EnumWindowsProc,(LPARAM)&wi);rn return HWND(wi.hProcess);rn rn4。激活ie窗口rnrnvoid CIEChange1Dlg::OnButton2() rnrn ::SetActiveWindow(GetProcessMainWnd(p1.dwProcessId));rn rnrnrn为什么到弟4步,老实不能激活窗口,从而实现窗口的切换呢??rn
!oracle8i为什么装不了呢?
公司里几台机子装的是win2k server,装oracle8i时都装<em>不了</em>。rnrn点了安装后就没反应了。而我实验室的机子是win2k pro却能装。rnrn这是怎么回事呢?rnrn<em>急</em>!!rn//bow~~~
为什么我建不了Mysql的数据库呢?
安装完后准备建立 mydb 的<em>数据库</em>但是怎么也建<em>不了</em>,怎么解决啊?rnrnmysql>create database mydb;rnERROR 1044: Access denied for user:'@localhost' to database 'mydb'
为什么,这个操作执行不了更新不了数据库
lblMessage.Text="";rn if((txtpwd.Text==null)||(txtpwd.Text=="")||rn (txtNewPwd1.Text==null)||(txtNewPwd1.Text=="")||rn (txtNewPwd2.Text==null)||(txtNewPwd2.Text==""))rn rn lblMessage.Text="请检查你输入的密码,是否有误!";rn rn if(Page.IsValid)rn rn string pwd;rn pwd=txtpwd.Text.Trim().Replace("'","''");rn sqlConnection1.Open();rn sqlDataAdapter1.Fill(dataSet21,"Userpwd");rn sqlConnection1.Close(); rnrn foreach(DataRow myRow in dataSet21.Tables["Userpwd"].Rows)rn rn if(myRow[1].ToString().Trim().ToLower()==pwd.ToString())rn rn lblMessage.Text="用户密码修改成功!";rn return;rn rn rn tryrn rn sqlDataAdapter1.UpdateCommand.Parameters[0].Value=txtNewPwd1.Text.Trim();rn sqlDataAdapter1.UpdateCommand.Parameters[1].Value=Session["usrName"].ToString();rn sqlConnection1.Open();rn sqlDataAdapter1.UpdateCommand.ExecuteNonQuery();rn sqlConnection1.Close();rn lblMessage.Text="用户密码修改成功!"; rn rn catchrn rn lblMessage.Text="用户密码修改不成功,系统错误!";rn sqlConnection1.Close();rn rn dataSet21.Clear();rn ");rn rn rnrnrnrnrn…………………………………………………………………………………………………………rnrn…………………………………………………………………………………………………………rn还有一个问题:rn如何,自动跳转到前面访问过的几个页面?
为什么运行不了呢?
这是一个简单的小程序,为什么总是提示中的 id="calculator"错误,而且程序中的所有的calculator都rn会报错,这是怎么一回事?请求高手解答,谢谢rnrnrncalculate.jsprnrnrnrnrnrnrnrnrnrnrn 简单计算器rn rnrnrn 简单计算器rn rn计算结果:rn rn rn rn rn 第一个参数rn rn rn rn rn 操作符rn rn +rn -rn *rn /rn rn rn rn rn 第二个参数rn rn rn rn rn rn rn rn rn rn rnrnrnrnrnpackage myjsp;rnrnpublic class simplecalculate rn private String first;rn private String second;rn private double result;rn private String operator;rn rn public void setFirst(String first)rn this.first=first;rn rn public void setSecond(String second)rn this.second=second;rn rn public void setOperator(String operator)rn this.operator=operator;rn rn rn public String getFirst()rn return this.first;rn rn public String getSecond()rn return this.second;rn rn public String getOperator()rn return this.operator;rn rn public double getResult()rn return this.result;rn rn rn public void calculator()rn double one=Double.parseDouble(first);rn double two=Double.parseDouble(second);rn rn tryrn if(operator.equals("+"))result=one+two;rn else if(operator.equals("-"))result=one+two;rn else if(operator.equals("*"))result=one+two;rn else if(operator.equals("/"))result=one+two;rn rn catch(Exception e)System.out.println(e);rn rnrnrnrn
为什么跳转不了呢?
webform下 左右分栏,左边是按钮rnrnrn右边是跳转页rnrn预先创建了一个空白页rn rn rn rnrnrn我想要的功能是 点左边,按钮链接, 右边的temweb显示webb.aspx 的内容rn protected void Button1_Click1(object sender, EventArgs e)rn rn this.temweb.ResolveUrl("webb.aspx");rn rn rn rn rn rnrn代码错了??
为什么图片显示不了
以下是代码,不知道为什么,这个图片就是显示<em>不了</em>.目录结构是没有问题的应该rnrnrnrnrnrnrnrn 登陆rnrn rn rn rn VASP Perf And Alarm Display rn rn rn ">rn rn UserName: rn PassWord: rn rn rn rn rn rn rn rn rn rnrn
为什么保存不了呢?
http://www.su27.net/vml/step33.htmlrnrn试验的时候没法子保存呀,你们的可以么?
为什么访问不了
我用C#连接<em>数据库</em>。rn系统自带的<em>数据库</em>能连上。自带的表能查询。rn为什么我自己建的<em>数据库</em>不行,sa说登陆不成功。rnsa可是已经拥有了最大的权限了。rn我无语,谁能救救我。
为什么添加不了呢?
我是想用JS在表格后添加一行,代码如下:rnrnrnrnrn rn 无标题文档rnrnrn[color=#0000FF] rnFirst txtrn[/color]rn[color=#800000] [/color]rn[color=#FF0000] [/color]rn rn rn rn 0101rn 0102rn 0103rn 0104rn rn rn 02rn 0202rn 0203rn 0204rn rnrn[color=#800000][/color]rnrnrnrn[color=#FF0000]现在出现的问题是:[/color]rnJS向表格添加一行时,在[color=#FF0000]FF[/color]下能成功添加;在[color=#FF0000]MS IE [/color]6.0下能运行(没有错误报告,已经在后面加 alert 检测)但不能添加行列到表格中,不得其解, 为什么MS IE下能运行但添加不成功呢?!见JS函数 [color=#FF0000]addELM2()[/color]rnrn[color=#FF0000]比较相同的问题:[/color]rn用JS函数 [color=#FF0000]addELM()[/color] 向 id="img" 的DIV添加一个div子元素,去能正确在 FF, MS IE下都能正确运行,为什么这里都可以运行成功,而上面的在MS IE下不能向表添加一行呢?。。。在线等,解决了就结贴rn
为什么这样做不可以更新数据库呢?
tryrn // create a prepared SQL statementrn PreparedStatement updateacc;rn String strSQL="UPDATE usraccount SET usermoney=?,ioflag=?,ftype=?,userbak=? where ID=?"; rn updateacc = con.prepareStatement(strSQL);rn updateacc.setInt(1, money); rn updateacc.setInt(2, ioflag); rn updateacc.setInt(3, ftype); rn updateacc.setString(4, bak); rn updateacc.setString(5, id);rn updateacc.executeUpdate();rn rn其中,变量money,ioflag,ftype,bak,id是传递过来的rn这个执行不报错,可是也不<em>更新</em><em>数据库</em>,为什么?rn谢谢。
为什么提示数据库提示不支持更新呢?
Option ExplicitrnPrivate conn As New ADODB.ConnectionrnPrivate rs As New RecordsetrnPrivate rs1 As New RecordsetrnPrivate rs2 As New RecordsetrnPrivate sql As StringrnPrivate sql1 As StringrnPrivate sql2 As StringrnrnPrivate Sub aladd_Click()rnDim myalrnIf anli.Text = "" Thenrnmyal = MsgBox("请输入按力!", vbYes, "omten")rnanli.SetFocusrnExit SubrnEnd Ifrnrnsql = "select * from jcal where anli='" & Trim(anli.Text) & "'"rnrs.Open sql, conn, adOpenKeyset, adLockPessimisticrnIf Not rs.EOF Thenrnmyal = MsgBox("数据已经存在!", vbYes, "omten")rnrs.ClosernElsernrs.AddNewrnrs("anli") = Trim(anli.Text)rnrs.Updaternrs.Closernmyal = MsgBox("数据提交成功!", vbYes, "omten")rnanli.Text = ""rnEnd IfrnEnd SubrnrnPrivate Sub anbadd_Click()rnDim myanbrnIf anbcolor.Text = "" Thenrnmyanb = MsgBox("请输入按柄颜色", vbYes, "omten")rnanbcolor.SetFocusrnExit SubrnEnd Ifrnrnsql = "select * from jcanb where anbcolor='" & Trim(anbcolor.Text) & "'"rnrs.Open sql, conn, adOpenKeyset, adLockPessimisticrnIf Not rs.EOF Thenrnmyanb = MsgBox("数据已经存在!", vbYes, "omten")rnrs.ClosernElsernrs.AddNewrnrs("anbcolor") = Trim(anbcolor.Text)rnrs.Updaternrs.Closernmyanb = MsgBox("数据提交成功!", vbYes, "omten")rnanbcolor.Text = ""rnEnd IfrnEnd SubrnrnPrivate Sub Command1_Click()rnDim myxhgg, cg, myprolei, mypronamernIf xhgg.Text = "" Thenrnmyxhgg = MsgBox("请输入型号规格!", vbYes, "omten")rnxhgg.SetFocusrnExit SubrnEnd IfrnrnIf prolei.Text = "" Thenrnmyprolei = MsgBox("请输入产品类别!", vbYes, "omten")rnprolei.SetFocusrnExit SubrnEnd IfrnrnIf proname.Text = "" Thenrnmyproname = MsgBox("请输入产品中文名称!", vbYes, "omten")rnproname.SetFocusrnExit SubrnEnd Ifrnrnsql = "select * from jcpro where xhgg='" & Trim(xhgg.Text) & "'"rnrs.Open sql, conn, adOpenKeyset, adLockPessimisticrnIf Not rs.EOF Thenrnmyxhgg = MsgBox("数据已经存在!", vbYes, "omten")rnrs.ClosernElsernrs.AddNewrnrs("xhgg") = Trim(xhgg.Text)rnrs("prolei") = Trim(prolei.Text)rnrs("proname") = Trim(proname.Text)rnrs.Updaternrs.Closerncg = MsgBox("数据添加成功!", vbYes, "omten")rnxhgg.Text = ""rnprolei.Text = ""rnproname.Text = ""rnEnd IfrnEnd SubrnrnPrivate Sub Command2_Click()rnIf zw.Text = "" ThenrnDim myzwrnmyzw = MsgBox("请输入职位!", vbYes, "omten")rnzw.SetFocusrnExit SubrnEnd IfrnrnIf xm.Text = "" Thenrnmyzw = MsgBox("请输入姓名!", vbYes, "omten")rnxm.SetFocusrnExit SubrnEnd IfrnrnIf username.Text = "" Thenrnmyzw = MsgBox("请输入用户名!", vbYes, "omten")rnusername.SetFocusrnExit SubrnEnd IfrnrnIf pwd.Text = "" Thenrnmyzw = MsgBox("请输入密码!", vbYes, "omten")rnpwd.SetFocusrnExit SubrnEnd Ifrnrnsql = "select * from omt where username='" & Trim(username.Text) & "' and pwd='" & Trim(pwd.Text) & "' and zw='" & Trim(zw.Text) & "'"rnrs.Open sql, conn, adOpenKeyset, adLockPessimisticrnIf Not rs.EOF Thenrnmyzw = MsgBox("数据已经存在!", vbYes, "omten")rnrs.ClosernElsernrs.AddNewrnrs("zw") = Trim(zw.Text)rnrs("xm") = Trim(xm.Text)rnrs("username") = Trim(username.Text)rnrs("pwd") = Trim(pwd.Text)rnrs("phone") = Trim(phone.Text)rnrs("mob") = Trim(mob.Text)rnrs.Updaternrs.Closernmyzw = MsgBox("数据添加成功!", vbYes, "omten")rnzw.Text = ""rnxm.Text = ""rnusername.Text = ""rnpwd.Text = ""rnphone.Text = ""rnmob.Text = ""rnEnd IfrnEnd SubrnrnPrivate Sub Command3_Click()rnIf kname.Text = "" ThenrnDim mykrnmyk = MsgBox("请输入库名!", vbYes, "omten")rnkname.SetFocusrnExit SubrnEnd Ifrnrnsql1 = "select * from jckname where kname='" & Trim(kname.Text) & "'"rnrs1.Open sql1, conn, adOpenKeyset, adLockPessimisticrnIf Not rs1.EOF Thenrnmyk = MsgBox("数据已经存在!", vbYes, "omten")rnrs1.ClosernElsernrs1.AddNewrnrs1("kname") = Trim(kname.Text)rnrs1.Updaternrs1.Closernmyk = MsgBox("数据添加成功!", vbYes, "omten")rnkname.Text = ""rnEnd IfrnEnd SubrnrnPrivate Sub Command4_Click()rnIf ck.Text = "" ThenrnDim myckrnmyck = MsgBox("请输入仓库的名称!", vbYes, "omten")rnck.SetFocusrnExit SubrnEnd Ifrnrnsql2 = "select * from jcck where ck='" & Trim(ck.Text) & "'"rnrs2.Open sql2, conn, adOpenKeyset, adLockPessimisticrnIf Not rs2.EOF Thenrnmyck = MsgBox("数据已经存在!", vbYes, "omten")rnrs2.ClosernElsernrs2.AddNewrnrs2("ck") = Trim(ck.Text)rnrs2("qy") = Trim(qy.Text)rnrs2("xq") = Trim(xq.Text)rnrs2("hg") = Trim(hg.Text)rnrs2("jc") = Trim(jc.Text)rnrs2.Updaternrs2.Closernmyck = MsgBox("数据添加成功!", vbYes, "omten")rnck.Text = ""rnqy.Text = ""rnxq.Text = ""rnhg.Text = ""rnjc.Text = ""rnEnd IfrnrnEnd SubrnrnPrivate Sub Command5_Click()rnUnload MernEnd SubrnrnPrivate Sub Command6_Click()rnUnload MernEnd SubrnrnPrivate Sub Command7_Click()rnUnload MernEnd SubrnrnPrivate Sub Form_Load()rnconn.ConnectionString = "Driver=sql server;server=sjf;uid=;pwd=;database=cn114_1"rnconn.ConnectionTimeout = 30rnconn.OpenrnEnd SubrnrnPrivate Sub Form_Unload(Cancel As Integer)rnconn.ClosernEnd SubrnrnPrivate Sub jtadd_Click()rnDim myjtrnIf jtcolor.Text = "" Thenrnmyjt = MsgBox("请输入机体颜色!", vbYes, "omten")rnjtcolor.SetFocusrnExit SubrnEnd Ifrnrnsql = "select * from jcjt where jtcolor='" & Trim(jtcolor.Text) & "'"rnrs.Open sql, conn, adOpenKeyset, adLockPessimisticrnIf Not rs.EOF Thenrnmyjt = MsgBox("数据已经存在!", vbYes, "omten")rnrs.ClosernElsernrs.AddNewrnrs("jtcolor") = Trim(jtcolor.Text)rnrs.Updaternrs.Closernmyjt = MsgBox("数据添加成功!", vbYes, "omten")rnjtcolor.Text = ""rnEnd IfrnEnd SubrnrnPrivate Sub packadd_Click()rnDim mypackrnIf pack.Text = "" Thenrnmypack = MsgBox("请输入包装情况!", vbYes, "omten")rnpack.SetFocusrnExit SubrnEnd Ifrnrnsql = "select * from jcpack where pack='" & Trim(pack.Text) & "'"rnrs.Open sql, conn, adOpenKeyset, adLockPessimisticrnIf Not rs.EOF Thenrnmypack = MsgBox("数据已经存在!", vbYes, "omten")rnrs.ClosernElsernrs.AddNewrnrs("pack") = Trim(pack.Text)rnrs.Updaternrs.Closernmypack = MsgBox("数据提交成功!", vbYes, "omten")rnpack.Text = ""rnEnd IfrnEnd SubrnrnPrivate Sub prodjadd_Click()rnDim myprodjrnIf prodj.Text = "" Thenrnmyprodj = MsgBox("请输入产品等级!", vbYes, "omten")rnprodj.SetFocusrnExit SubrnEnd Ifrnrnsql = "select * from jcprodj where prodj='" & Trim(prodj.Text) & "'"rnrs.Open sql, conn, adOpenKeyset, adLockPessimisticrnIf Not rs.EOF Thenrnmyprodj = MsgBox("数据已经存在!", vbYes, "omten")rnrs.ClosernElsernrs.AddNewrnrs("prodj") = Trim(prodj.Text)rnrs.Updaternrs.Closernmyprodj = MsgBox("数据提交成功!", vbYes, "omten")rnprodj.Text = ""rnEnd IfrnEnd SubrnrnPrivate Sub Text1_Change()rnrnEnd SubrnrnPrivate Sub SSTab1_DblClick()rnrnEnd Subrn
修改页面为什么不能更新数据库呢?
rnrnrnrnrn 会员申请表rn rn rnrnrnrnrnrnrnrn---------------------------------------------------------------------rn以上就是编辑页面源代码,但是为什么不能<em>更新</em><em>数据库</em>呢???
为什么我的语句更新不了
Update 表名 rnSet 字段1 =getdate()rnwhere nname='f123' rnand rnworkdate=2003-7-1rnGOrn
为什么更新不了directX版本
我用的操作系统是windows home版本的,前几天下载了热血江湖,下载下来后告诉我要我把directX版本升级到9.0以上,我已经下载安装了,但是directX诊断工具为什么还是原来8.1的版本呢?我的游戏也运行<em>不了</em>,怎么办?等待.
这样写为什么更新不了
area是下拉框,我想改变选项(即<em>更新</em>),然后提交,下面的代码不行,为什么?rnarea='" + Request.Form["area.SelectedItem.Text"] + "'
这是怎么回事,为什么更新不了
[code=C#] string hyid = Request.QueryString["id"];rn string Tbmm = MD5("000000");rn string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("../App_Data/data.mdb");rn OleDbConnection conn = new OleDbConnection(connectionString);rn OleDbCommand cmd = new OleDbCommand("UPDATE huiyuan SET hymm = @hymm where id = @id", conn);rn cmd.Parameters.Add("@id", hyid);rn cmd.Parameters.Add("@hymm", Tbmm);rn conn.Open();rn cmd.ExecuteNonQuery();rn conn.Close();rn this.Label11.Text = "初始化会员密码成功";rn[/code]rn这是程序代码rnrnid 是自动编号类型
为什么不能更新
boolean rt = false;rn ResultSet rs = null;rn String str_sql =rn " select colID,lstID, title, content, usephoto, phototype, photopos, photores, creatdate, todate from datalist where colID = " +rn colID + " and lstID = " + ItemID;rn if (this.initConnection()) rn try rn Statement stmt = this.m_dbcon.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);rn rs = stmt.executeQuery(str_sql);rn rs.updateString(3, title);rn ByteArrayInputStream ls= new ByteArrayInputStream(content);rn rs.updateBinaryStream(4, ls, content.length);rn rs.updateString(5, useph);rn rs.updateString(6, phtype);rn rs.updateString(7, phpos);rn rs.updateString(8, phres);rn rs.updateString(9, createDate);rn rs.updateString(10, toDate);rn rs.updateRow();rn rs.close();rn stmt.close();rn rt = true; //成功rn rn catch (Exception ex) rnrn rnrn为什么这样写不能<em>更新</em>呢?到 rs.updateString(3, title); 就异常;rn下面是异常原因(我已经把所有的字段都检索出来了)rnResult Set not updatable.This result set must come from a statement that was created with a result set type of ResultSet.CONCUR_UPDATABLE, the query must select only one table, and must select all primary keys from that table. See the JDBC 2.1 API Specification, section 5.6 for more details.rn
奇怪,更新数据库怎么更新不了
ASP代码如下:rnrnrnrnrnrnrn能够执行到语句response.write"新闻已经通过审核",但上面的<em>更新</em>语句根本没有执行,也不提示任何错误,奇怪。
!我的cookies更新不了
我是这样写入的:rnHttpCookie myCookie = new HttpCookie("SupperCookies");rn..................省略..............rnmyCookie["HomeID"] = 'aaa';rnHttpContext.Current.Response.Cookies.Add(myCookie);rnrn在用户做某个操作后,我想把其中的某一个值改变,比如myCookie["HomeID"]之前是'aaa',现在想改成'bbb',就是实现<em>不了</em>啊,开始是根据旧cookies来生成一个新cookies,让要改变的值不同,后来是直接改了值,再调用SetCookie方法,也还是不行啊。
~~~~~~gridview的更新事件触发不了
rn rnrnprotected void Page_Load(object sender, EventArgs e)rn rn rn if (!IsPostBack)rn rn displayMeun();rn panel1.Visible = false;rn rn rn gvshow.RowEditing += new GridViewEditEventHandler(gvshow_RowEditing);rn gvshow.RowCancelingEdit += new GridViewCancelEditEventHandler(gvshow_RowCancelingEdit);rn gvshow.RowUpdating +=new GridViewUpdateEventHandler(this.gvshow_RowUpdating);rn rnrn gvshow.RowDeleting += new GridViewDeleteEventHandler(gvshow_RowDeleting);rn divshow.Controls.Add(gvshow);rnrn load();rn rn rnrn protected void bind()rn rn DataTable dt = getColumnField(); //获得数据源rn DataTable dt1 = getDataSource();rn //gvshow = new GridView();rn rn gvshow.Width = Unit.Pixel(500);rn rn divshow.Controls.Add(gvshow);rnrn gvshow.AutoGenerateColumns = false;rn rn rn for (int i = 0; i < dt.Rows.Count; i++)rn rn BoundField bc = new BoundField();rn bc.DataField = dt.Rows[i][0].ToString();rn bc.HeaderText = dt.Rows[i][1].ToString();rn if (i == 0)rn rn bc.ReadOnly = true;rn rn gvshow.Columns.Add(bc);rn rnrn CommandField edit = new CommandField();rn CommandField delete = new CommandField();rn gvshow.Columns.Add(edit);rn gvshow.Columns.Add(delete);rnrn rn edit.HeaderText = "编辑";rn edit.ShowEditButton = true;rn edit.ControlStyle.Width=80;rn delete.HeaderText = "删除";rn delete.ShowDeleteButton = true;rn delete.ControlStyle.Width = 80;rnrn this.gvshow.DataKeyNames = new string[] "id" ;rn gvshow.DataSource = dt1;rn gvshow.DataBind();rn rnrn protected void gvshow_RowEditing(object sender, GridViewEditEventArgs e)rn rn gvshow.EditIndex = e.NewEditIndex;rn bind();rn rnrnprotected void gvshow_RowUpdating(object sender, GridViewUpdateEventArgs e) rn rn rn DataTable dt = getColumnField();rn for (int i = 1; i < dt.Rows.Count; i++)rn rnrn
为什么恢复不了数据库
以下是在oracle8+win2000的rman下执行的。rncreate script back rnallocate channel n1 type disk; rnbackup database rnformat '/data/backup/ora8_%d_%s_%p'; rnrelease channel n1;rnrunexecute script back; rn备份成功。可是恢复出错。我为了做试验删除了:rnC:\>del D:\ORACLE\ORADATA\TEST\SYSTEM01.DBFrnC:\>del D:\ORACLE\ORADATA\TEST\INDX01.DBFrnrnRMAN>connect rcvcat rman/rmanrnrnRMAN-00571: ===========================================================rnRMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============rnRMAN-00571: ===========================================================rnRMAN-04004: error from recovery catalog database: ORA-01033: ORACLE initializatirnon or shutdown in progressrnrn恢复脚本:rnrun rnallocate channel n1 type disk; rnrestore database; rnrecover database; rnsql "alter database open resetlogs"; rnrelease channel n1; rn我现在该怎么办?rn
sqldataadapter.update(databale)更新不了数据库
/// rn /// 将源<em>数据库</em>表的数据复制到 SQL Server Compact Edition <em>数据库</em>的表中。rn /// rn /// 源<em>数据库</em>连接接对象。rn /// 目标<em>数据库</em>连接对象。rn /// 源数据的查询语句。rn /// 目标<em>数据库</em>表名称。rn /// 本方法假设目标 SQL Server Compact Edition <em>数据库</em>的表已经存在。rn public static void UpDateTable(rn SqlCeConnection sqlceConnection,rn SqlConnection sqlConnection,rn string queryString,rn string destTableName)rn rn SqlCeCommand sqlceCommand = new SqlCeCommand(queryString, sqlceConnection);rn SqlCeDataReader ceReader = sqlceCommand.ExecuteReader(CommandBehavior.CloseConnection);rn object[] values;rnrn SqlCommand sqlCMD = new SqlCommand(queryString, sqlConnection);rn SqlDataAdapter myDA = new SqlDataAdapter(queryString, sqlConnection);rn //myDA.SelectCommand = sqlCMD;rn DataSet myDataSet = new DataSet();rn myDA.Fill(myDataSet, "TemTable");rn //获得数据表rn DataTable tbl_TemTable = myDataSet.Tables["TemTable"];rn int c = tbl_TemTable.Rows.Count;rn int colCount = tbl_TemTable.Columns.Count;rn //定义DataRow类型的变量rn DataRow myRow;rnrn while (ceReader.Read())rn rn //读取数据rn values = new object[ceReader.FieldCount];rn ceReader.GetValues(values);rnrn //使用数据表的NewRow方法返回新的DataRow对象,并赋值给变量myRowrn myRow = tbl_TemTable.NewRow();rn for (int i = 0; i < colCount; i++)rn rn myRow[i] = values[i];rn rn //将DataRow添加到数据表rn tbl_TemTable.Rows.Add(myRow);rn //<em>更新</em>rn //myRow.AcceptChanges();rn rn tryrn rn tbl_TemTable.AcceptChanges();rn int k=tbl_TemTable.Rows.Count;rn myDataSet.AcceptChanges();rn int i = myDA.Update(tbl_TemTable);rn rn catch (Exception e)rn rn MessageBox.Show(e.Message);rn rn ceReader.Close();rn rnrnUpdate 没有成功
哎~~~~,数据库怎么更新不了
如下代码: rn txtSQL = "select * from student_Info"rn Set mrc = ExecuteSQL(txtSQL, MsgText)rn mrc.AddNewrn mrc.Fields(0) = Trim(txtSID.Text)rn mrc.Fields(1) = Trim(txtName.Text)rn mrc.Fields(2) = Trim(comboSex.Text)rn mrc.Fields(3) = Trim(txtBorndate.Text)rn mrc.Fields(4) = Trim(comboClassno.Text)rn mrc.Fields(5) = Trim(txtTel.Text)rn mrc.Fields(6) = Trim(txtRudate.Text)rn mrc.Fields(7) = Trim(txtAddress.Text)rn mrc.Fields(8) = Trim(txtComment.Text)rn mrc.Updatern MsgBox "添加学籍信息成功!", vbOKOnly + vbExclamation, "警告"rn mrc.Closern Me.HidernExecuteSQL 是执行SQL语言的函数,为什么每次编译到 Update都显示实时错误rnInvalid date format rnrn请各位告诉指教
为何总是更新不了数据库
本人用adodc控件来<em>更新</em>一个mdb的<em>数据库</em>,但是不定期地出现错误信息:键列信息不足或不正确,<em>更新</em>影响到过多的行。请问为什么?有什么解决方法?谢谢rn
不知为何更新不了数据库
本人是个菜鸟,在做练习的时候,不知为何<em>更新</em><em>不了</em><em>数据库</em>,查了很久也查不出来。程序如下:rnrnpublic static SqlDataAdapter sqldadp;rnpublic static DataTable dt; rn protected void Button2_Click1(object sender, EventArgs e)rn rnrn SqlConnection conn = new SqlConnection();rn conn.ConnectionString = "Data Source=localhost; Initial Catalog=Northwind; Integrated Security=True;"; //连接Northwind<em>数据库</em>rn conn.Open();rn sqldadp.SelectCommand.Connection = conn;rn dt.Rows[0]["ContactName"] = ContactName.Text.ToString();rn dt.Rows[0]["CompanyName"] = CompanyName.Text.ToString();rn dt.Rows[0]["Phone"] = Phone.Text.ToString();rn dt.Rows[0]["Address"] = Address.Text.ToString();rn dt.AcceptChanges();rn sqldadp.Update(dt);rn Response.Write("数据<em>更新</em>成功!");rn rn rnrnrn测试时也能显示“数据<em>更新</em>成功!”,但就是<em>数据库</em>里面的数据没有改变。我看了很久,查不出错在哪?大家帮忙看看吗?
请问数据库怎么更新不了
代码如下:rnrnImports System.Data.SqlClientrnPublic Class FillDSrn Public SqlAdp As New SqlDataAdapterrn Public Sqlconn As SqlConnectionrn Public Function F_FillDS(ByVal strSelect As String) As DataSetrn Dim ConnString As String = "....连接到<em>数据库</em>的string...." rn Sqlconn = New SqlConnection(ConnString)rn Dim DS As New DataSetrn SqlAdp.SelectCommand = New SqlCommand(strSelect, Sqlconn)rn Sqlconn.Open()rn DS.Clear()rn SqlAdp.Fill(DS)rn Sqlconn.Close()rn Return DSrn End Functionrn Public Function F_UpdateDB(ByVal dsName As DataSet)rn Sqlconn.Open()rn SqlAdp.Update(dsName)rn Sqlconn.Close()rn End FunctionrnEnd Classrn============================rn在主窗体中:rnrn Public c1 As New FillDSrn Public ds1 As DataSetrn ds1 = c1.F_FillDS("....select语句....")rn ......rn 与窗体控件绑定的代码rn ......rn点击保存按钮后:rnrn me.BindingContext(ds1, ds1.Tables(0).TableName).EndCurrentEdit()rn ds1.AcceptChanges()rn c1.F_UpdateDB(ds1)rnrnrnrn老师们请看看这么做为什么不能<em>更新</em><em>数据库</em>?哪里不对?运行没有任何错误提示rnrn另外还有一个问题,没有分了,两个问题一起问,呵呵rnrn Dim ConnString As String = ""....连接到<em>数据库</em>的string...." rn Dim SqlConn As New SqlConnection(ConnString)rn Dim dReader As SqlDataReaderrn Dim SqlCmd As New SqlCommandrn SqlCmd.CommandText = "select * from tb1 where username = @name"rn SqlCmd.CommandType = CommandType.Textrn SqlCmd.Connection = SqlConnrn SqlCmd.Parameters("name").Value = txtname.text rn '或者SqlCmd.Parameters(0).Value = txtname.text rn SqlConn.Open()rn dReader = SqlCmd.ExecuteReader()rn Sqlconn.closern运行后提示没有这个参数,请问是怎么回事?用"?"代替"@name"也不行。rn
为什么访问不了数据库
rn我用的是mysql,mydatabase在其data子文件夹下,里面有一个表,加载了驱动包 mysql-connector-java-3.1.12-bin.jar,在Eclipse写下面程序,为什么提示我访问不到mydatabase呢?rn程序如下:rnpackage mypackage;rnrnimport java.sql.*;rnrnpublic class DatabaseConnection rnrn public static void main(String [] args) rn rn String driver = "com.mysql.jdbc.Driver";rn String url = "jdbc:mysql://localhost/mydatabase";rn String user = "root";rn String password = "harmony";rn rn rn tryrn rn Class.forName(driver);rn Connection con = DriverManager.getConnection(url,user,password); rn String insert = "insert friends(id,name) values(?,?)";rn PreparedStatement prestatement = con.prepareStatement(insert);rn String [] names = "Rachel","Rose","Phoebe","Monica","Chandler","Joey";rn for(int i = 0;i < 6;i++ )rn rn prestatement.setInt(1,i);rn prestatement.setString(2,names[i]);rn prestatement.execute();rn rn rn String query = "select * from friends";rn ResultSet result = prestatement.executeQuery(query);rn rn System.out.println("The Results is:");rn while (result.next())rn rn System.out.println(result.getString("name"));rn rn con.close();rn rn catch(SQLException e)rn rn e.printStackTrace();rn catch (ClassNotFoundException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn rnrnrnrnrn出错信息如下:rnjava.sql.SQLException: Unknown database 'mydatabase'rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)rn at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3649)rn at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1176)rn at com.mysql.jdbc.Connection.createNewIO(Connection.java:2558)rn at com.mysql.jdbc.Connection.(Connection.java:1485)rn at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)rn at java.sql.DriverManager.getConnection(DriverManager.java:582)rn at java.sql.DriverManager.getConnection(DriverManager.java:185)rn at mypackage.DatabaseConnection.main(DatabaseConnection.java:18)rnrnrn请各位帮帮小弟的忙,我刚开始学习jdbc
为什么打开不了数据库
rnrnrnrnrnrnrnrnrn就这么简单的代码,可是,执行后报下面的错误:rn错误类型:rnMicrosoft OLE DB Provider for ODBC Drivers (0x80004005)rn[Microsoft][ODBC 驱动程序管理器] 驱动程序的 SQLAllocHandle on SQL_HANDLE_ENV 失败rn/myweb/test.asp, 第 10 行rn
更新不了本地数据库 求救!!!
CEMQUserDataSet ds2;rn ds2.m_pDBConnection=(CDBConnection*)CallService(MS_SQL_GETDBCONNECTION,0,0);rn ds2.UpdateLocalDataSet(data);rnrn//CEMQUserDataSet 是一个数据结构 包含了要操作表的相应字段rnrnrnrn strcpy(sql,"update muser set uname=:uname,mobile=:mobile,\rn sexual=:sexual,email=:email,\rn phone=:phone,address=:address,\rn birthday=:birthday,\rn office_phone=:office_phone,postal_code=:postal_code,\rn headimage=:headimage,self_description=:self_description,self_uw=:self_uw\rn where userid=:userid and eid=:eid;");rnrn stmt = m_pDBConnection->m_Conn.compileStatement(sql);rn bindLocalDataSet(user);rn stmt.execDML();rnrn//执行<em>更新</em><em>数据库</em>的操作rnrnrnrn但数据就是<em>更新</em><em>不了</em>,不知到什么情况? 请大虾帮忙!!rn
linq to sql 更新不了数据库。。
public class Service1rn rn DataClasses1DataContext db = new DataClasses1DataContext();rnrn [OperationContract]rn public ObservableCollection GetProducts()rn rn var query = from product in db.MyTable select product;rn ObservableCollection t = new ObservableCollection(query.ToList()); rn return t;rn rn [OperationContract]rn public void AddProduct(MyTable m)rn rn db.MyTable.InsertOnSubmit(m);rn db.SubmitChanges();rn rn [OperationContract]rn public void DeleteProduct(int id)rn rn var query = from s in db.MyTable where s.TableId == id select s;rn MyTable m = query.First();rn db.MyTable.DeleteOnSubmit(m);rn db.SubmitChanges();rn rn [OperationContract]rn public void SaveProduct()rn rn db.SubmitChanges(); rn rn // 在此处添加更多操作并使用 [OperationContract] 标记它们rn rnrnrn删除可以删除,可是更改和添加都<em>更新</em><em>不了</em><em>数据库</em>!这可怎么办?
update怎么更新不了数据库
我用update先<em>更新</em>了<em>数据库</em>的一条记录(之前我把视图里的usernow删掉才能<em>更新</em>的),后来又用它<em>更新</em>另外的记录却不行,不知是哪的问题,求助各位大哥!
OleDbDataAdapter 怎么更新不了数据库
代码如下,请各位大哥帮帮忙。rnString sql = "select * from BOM_Item";rnOleDbConnection oleConn = new OleDbConnection(oleCnnStr);rn rnrnOleDbDataAdapter oleAdaper = new OleDbDataAdapter();//sql,oleConn);rnoleAdaper.SelectCommand = new OleDbCommand(sql, oleConn);rnrnOleDbCommandBuilder MyCommandBuild = new OleDbCommandBuilder(oleAdaper);//rnoleConn.Open();rnDataSet ds = new DataSet();rnoleAdaper.Fill(ds);rnString tbName = ds.Tables[0].TableName;rnString tem = ds.Tables[0].Rows[0]["BOMID"].ToString();rnDataRow dr = ds.Tables[0].NewRow();rndr["BOMID"] = "104";rndr["Quantity"] = 10;rnds.Tables[0].Rows.Add(dr);rn rnds.AcceptChanges();rn rnoleAdaper.Update(ds,ds.Tables[0].TableName);//这里不就是<em>更新</em><em>数据库</em>吗?rn
DbDataadapter更新不了数据库的问题
[code=C#]rn DbProviderFactory dbf=DbProviderFactories.GetFactory("System.Data.OracleClient");rn string strSql = "select * from mcemployeeinfogs where rownum=1";rn DbCommand cmd2 = db1.GetSqlStringCommond(strSql);rn DbDataAdapter ddb = dbf.CreateDataAdapter();rn ddb.SelectCommand = cmd2;rn DataSet dsd = new DataSet();rn //dsd.Tables.Add("mcemployeeinfogs");rn ddb.Fill(dsd);rn dsd.Tables[0].TableName = "mcemployeeinfogs";rn dsd.Tables[0].PrimaryKey = new DataColumn[] dsd.Tables[0].Columns[0] ; rn DbCommandBuilder dcb = dbf.CreateCommandBuilder();rn dcb.DataAdapter = ddb;rn ddb.InsertCommand = dcb.GetDeleteCommand();rn ddb.UpdateCommand = dcb.GetUpdateCommand();rn ddb.DeleteCommand = dcb.GetDeleteCommand();rn //dsd = dst;rn DataRow dr = dst.Tables[0].Rows[0];rn //dst.Tables[0].Rows.Remove(dr);rn dsd.Tables[0].Rows.Add(dr.ItemArray);rn rn ddb.Update(dsd,"mcemployeeinfogs");rn dsd.AcceptChanges();rn Console.Write("OK");rn[/code]rn其中dst是和dsd结构一样但是有数据的数据集rn现在程序可以执行但是<em>更新</em>不到<em>数据库</em>rn哪位帮帮忙啊
新手求救:更新不了数据库
我用的是ACCESS<em>数据库</em>,先建立<em>数据库</em>的连接,代码如下:rnstring mycon=@"Provider=Microsoft.Jet.OlEDB.4.0;Data Source=F:\\jh\custInfos.mdbrnmyconnection = new OleDbConnection(mycon)rnstring mySelect="select * from personInfos ";rnmyDataSet= new DataSet ();rnmyconnection.Open();rnmyAdapter=new OleDbDataAdapter (mySelect,myConnection);rnmyCommandBuiler = new OleDbCommandBuilder (myAdapter);rnmyAdapter.Fill (myDataSet,"personInfos");rnmyConnection.Close ();rnbindCtrol();//将<em>数据库</em>里的字段绑定textBox控件函数rnmyBmb=this.BindingContext [myDataSet.Tables ["personInfos"]];rn然后在button1按钮里添加代码:myBmb.EndCurrentEdit ();myBmb.AddNew();rn再在button2按钮里添加代码: rnmyBmb.EndCurrentEdit ();myAdapter.Update(myDataSet,"personInfos");rn运行后,点击button2按钮出现错误为:“INSERT INTO 语法错误”!rn请高手指点!!!!!rnrnrn
session.createSQLQuery为什么不能更新数据库???
Query qq = ss.createSQLQuery("UPDATE CInfo as c set c.totalNum = c.totalNum + ? where c.id = ? ").setInteger(0, 1).setInteger(1, id);rn这条hql为什么不能<em>更新</em><em>数据库</em>????rn而且没有报异常,非常奇怪!!!!!!!!!!!rn大家帮帮忙,请赐教为什么???rn<em>急</em>啊!!!!!!
数据库不能更新呢~~~~~~~~~~~~~~``
各位同志帮忙了!rn我用SqlDataAdapter选一个表,用SqlCommandBuilder构造了SQLrn往表里插入了5条数据,在UPDATE前我跟踪了,数据是有的哦,rn但UPDATE返回0,数据也没有<em>更新</em>到<em>数据库</em>,有可能是什么原因呢?
怎样才能更新数据库呢?
我用UPDATE bank set money='"+newmoney+"' where customid='"+customid+"'"rn来<em>更新</em>access<em>数据库</em>rn但是服务器说update语法错误。rn但是我改成UPDATE bank set customname='"+newmoney+"' where customid='"+customid+"'"后,就可以成功改写rn<em>数据库</em>中money为双精度,customname为文本rnjsp网页中newmoney为floatrn请问怎样才能改写呢?rn谢谢!!
用update更新数据库,为什么更新不成功呢?
strSQL.Format("UPDATE %s SET %s='%s' WHERE 编号=%d" , table, strColTitle[1] , m_Name , m_no);rnDb.ExecuteSQL(strSQL);rn执行完没有任何变化?rn请问适合原因呢?
数据库启动不了
各位大虾好!现在<em>数据库</em>启动<em>不了</em>,帮忙看看怎么解决,先谢谢各位了。rn 相关信息如下:rn 1、tnsping dgtest,能通rn 2、D:\oracle\product\10.1.0\db_1\BIN>SET ORACLE_SID=dgtest;rn D:\oracle\product\10.1.0\db_1\BIN>oradim -startup -sid dgtest;rn DIM-00011: 该服务不存在rn O/S-Error: (OS 1060) 指定的服务未安装。rn 3、tnsnames.ora配置如下rn dgtest =rn (DESCRIPTION =rn (ADDRESS_LIST =rn (ADDRESS = (PROTOCOL = TCP)(HOST = www-46d543c76ad)(PORT = 1521))rn )rn (CONNECT_DATA =rn (SERVICE_NAME = dgtest)rn )rn )rn 4、listener。ora配置如下:rn # listener.ora Network Configuration File: D:\oracle\product\10.1.0\db_1\network\admin\listener.orarn # Generated by Oracle configuration tools.rnrn SID_LIST_LISTENER =rn (SID_LIST =rn (SID_DESC =rn (SID_NAME = PLSExtProc)rn (ORACLE_HOME = D:\oracle\product\10.1.0\db_1)rn (PROGRAM = extproc)rn )rn )rnrn LISTENER =rn (DESCRIPTION_LIST =rn (DESCRIPTION =rn (ADDRESS_LIST =rn (ADDRESS = (PROTOCOL = TCP)(HOST = www-46d543c76ad)(PORT = 1521))rn )rn (ADDRESS_LIST =rn (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))rn )rn )rn )rnrn 5、sqlnet.ora配置如下:rn SQLNET.AUTHENTICATION_SERVICES = (NTS)rn
数据库启动不了
刚升级了补丁到10.2.0.4,但是却无法启动了:rnSQL> startuprnORACLE instance started.rnrnTotal System Global Area 285212672 bytesrnFixed Size 1267068 bytesrnVariable Size 121637508 bytesrnDatabase Buffers 159383552 bytesrnRedo Buffers 2924544 bytesrnDatabase mounted.rnORA-01092: ORACLE instance terminated. Disconnection forcedrnrn下面是最近的一次日志:rn/opt/oracle/product/10.2.0/db_1/admin/orc_test/udump/orctest_ora_9494.trcrnOracle Database 10g Enterprise Edition Release 10.2.0.4.0 - ProductionrnWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsrnORACLE_HOME = /opt/oracle/product/10.2.0/db_1rnSystem name: LinuxrnNode name: oraclernRelease: 2.6.9-78.ELsmprnVersion: #1 SMP Fri Jul 25 00:04:28 EDT 2008rnMachine: i686rnInstance name: orctestrnRedo thread mounted by this instance: 1rnOracle process number: 15rnUnix process pid: 9494, image: oracle@oraclernrn*** ACTION NAME:() 2009-04-08 03:14:20.072rn*** MODULE NAME:(sqlplus@oracle (TNS V1-V3)) 2009-04-08 03:14:20.072rn*** SERVICE NAME:() 2009-04-08 03:14:20.072rn*** SESSION ID:(160.3) 2009-04-08 03:14:20.072rnThread 1 checkpoint: logseq 50, block 1686, scn 989405rn start recovery at logseq 50, block 1686, scn 989405rn----- Redo read statistics for thread 1 -----rnRead rate (ASYNC): 0Kb in 0.32s => 0.00 Mb/secrnTotal physical reads: 4096KbrnLongest record: 0Kb, moves: 0/1 (0%)rnLongest LWN: 0Kb, moves: 0/1 (0%), moved: 0MbrnLast redo scn: 0x0000.000f18de (989406)rn----------------------------------------------rn----- Recovery Hash Table Statistics ---------rnHash table buckets = 32768rnLongest hash chain = 0rnAverage hash chain = 0/0 = 0.0rnMax compares per lookup = 0rnAvg compares per lookup = 0/0 = 0.0rn----------------------------------------------rn*** 2009-04-08 03:14:20.431rnKCRA: start recovery claims for 0 data blocksrn*** 2009-04-08 03:14:20.432rnKCRA: blocks processed = 0/0, claimed = 0, eliminated = 0rn*** 2009-04-08 03:14:20.435rnRecovery of Online Redo Log: Thread 1 Group 2 Seq 50 Reading mem 0rn----- Recovery Hash Table Statistics ---------rnHash table buckets = 32768rnLongest hash chain = 0rnAverage hash chain = 0/0 = 0.0rnMax compares per lookup = 0rnAvg compares per lookup = 0/0 = 0.0rn----------------------------------------------rntkcrrsarc: (WARN) Failed to find ARCH for message (message:0x1)rntkcrrpa: (WARN) Failed initial attempt to send ARCH message (message:0x1)rnORA-00704: bootstrap process failurernORA-39700: database must be opened with UPGRADE optionrnrn请帮忙看一下,谢谢。
!数据库订阅不了?
我在跟我们经理做<em>数据库</em>订阅复制,就是连不上,哪位帮我看看,我的msn:wsm0524@hotmail.com.感谢!
各位帮我看看,为什么会提示更新不了数据呢?
rnrnrnrn rnrnrn rn Using SQL directlyrn rn rn
哥哥快来看看,为什么这样更新不了数据呢?
OleDbConnection conn = new OleDbConnection (Form1.connectionstring);rn conn.Open ();rnrn OleDbCommand updatecmd=new OleDbCommand ("update users set name='"+textBox2.Text+"'and pwd='"+textBox3.Text+"'and sex='"+textBox4.Text+"'and age='"+textBox5.Text+"'and address='"+textBox8.Text+"'and usertype='"+textBox6.Text+"'",conn);rnrnocmd.ExecuteNonQuery();rncon.Close ();
为什么数据库不能更新
我用access做的<em>数据库</em>在pb里面处理,当在database中update或在datawindow中update 时,会弹出窗口“Row changed between retrieve and update.”而无法<em>更新</em><em>数据库</em>,这该怎解决?望高手赐教。
为什么不能更新数据库
我用Acess 2000做的<em>数据库</em>rn从中读数据没有问题rn可无法修改该<em>数据库</em>rn代码如下:请各位高手帮忙看一下,不胜感激!rnrnrnrnrnrnPublic Sub DataModify()rn Dim DataRecSet As adoDB.Recordsetrn Set DataRecSet = New adoDB.Recordsetrnrn DataRecSet.Open "select * from FileInfo", G_SystemCon ,adOpenKeyset ,adLockOptimistic , adCmdTextrn rn rn If Not DataRecSet.EOF Or Not DataRecSet.BOF Thenrn DataRecSet.MoveFirstrn While Not DataRecSet.EOFrn rn DataRecSet!fName = G_filenamern rn DataRecSet.Updatern DataRecSet.MoveNextrn i = i + 1rn Wendrn End Ifrn DataRecSet.Closern Set DataRecSet = NothingrnrnEnd Subrn
这为什么显示不了呢?、、
[img=http://img.my.csdn.net/uploads/201211/27/1354017348_6738.png][/img][img=http://img.my.csdn.net/uploads/201211/27/1354017315_9252.png][/img]SqlConnection conn = new SqlConnection();rn conn.ConnectionString = @"server=LISHILIANG\SQLEXPRESS;database=郑州公交查询;uid=test;pwd=test";rn //conn.Open();aaaaaaaaarn SqlDataAdapter da = new SqlDataAdapter("SELECT * from 公交路线表", conn);rn DataSet ds = new DataSet();rn da.Fill(ds);rn dataGridView1.DataSource = ds.Tables[0].DefaultView;rn出现了拒绝对对象<em>数据库</em>表的SELECT的权限
为什么显示不了窗口呢
各位,我建了一个MDI窗体的子窗体,不知为什么在点击主窗体的相应菜单后显示不出来呢?rn相应菜单CLICKED事件的脚本:rnw_power_book child_windowrnopen(w_power_book,w_power)rn//w_power是主窗体,MDI类型的rnrn我的目的是在一个主窗体中显示多个子窗体,或层叠,或平铺
函数为什么执行不了呢?
我写的一个<em>数据库</em>连接函数,没有返回值,为什么不能执行?rnfunction myconnect()rn$conn=mysql_connect("$host","$user","$passwd") or die('连接<em>数据库</em>错误');rn mysql_select_db("$db",$conn);rn rnrn错误提示:rnWarning: mysql_connect() [function.mysql-connect]: Access denied for user: 'user@localhost' (Using password: NO) in /usr/www/users/luza/htdocs/admin/config.inc.php on line 8rn连接<em>数据库</em>错误.rnrn不用函数就可以
为什么释放不了空间呢?
#include rn#include rn#include rn#include rnrn#define SElemType char rn#define N 10rntypedef structrn rn SElemType *base; rn SElemType *top; rn int stacksize; rnSqStack; rnrnvoid InitStack(SqStack &S, int length) rn rn S.base = (SElemType *)malloc(length * sizeof(SElemType)); rn if (!S.base) rn rn exit(0); rn rn S.top = S.base; rn S.stacksize = length; rn rnrnvoid push(SqStack &S, SElemType e) rn rn *S.top++ = e; rn rnrnvoid pop(SqStack &S, SElemType &e) rn rn if (S.top != S.base) rn rn e = *--S.top; rn rn rnrnvoid ClearStack(SqStack &S) rn rn S.top = S.base; rn rnrnint main(void) rn rn int len=100, i=0, j=0; rn SElemType ch, e; rn SElemType *str;rn SElemType *string[5];rn SqStack S; rn InitStack(S, len); rn ch = getchar(); rn while (ch != EOF) //全文结束符 rn rn while (ch != EOF && ch != '\n') rn rn switch(ch) rn rn case '@':ClearStack(S);break; rn case '#':pop(S, e);break; rn default:push(S, ch); rn rn ch = getchar(); rn rn if (ch == '\n')rn rn i = 0;rn str = (SElemType *)malloc(sizeof(SElemType)*N*len);rn while (S.base != S.top)rn rn str[i++] = *S.base++;rn rn str[i] = '\0';rn string[j++] = str;rn rn ClearStack(S); //遇到'\n'rn if (ch != EOF) rn rn ch = getchar(); rn rn rn free(S.base);//去掉这条语句,程序就对的.那么这里为什么释放<em>不了</em>呢?应该如何修改?rn S.top = S.base = NULL;rn S.stacksize = 0;rn for (i=0; i
用户登录为什么验证不了呢?
rn代码如下: (为什么用户名和密码都正确它还是进<em>不了</em>"if (temp=="yes")"语句呢?一直跑到"else"语句,不知道哪里出错,请教高手们.)rnstring userName = userTb.Text;rnstring password = pwdTb.Text;rnstring connstr ="Data Source=localhost;Initial Catalog=pubs;Use ID=sa;Password=aaaa";rnSqlConnection conn = new SqlConnection(connstr);rnstring sqlstr ="select user,pwd from login where user='" + userName + "'and pwd='" + password + "'";rnSqlCommand cmd = new SqlCommand(sqlstr, conn);rnconn.Open();rnSqlDataReader sdr = cmd.ExecuteReader();rnstring temp="";rn while (sdr.Read())rn rn temp="yes";rn Response.Write("1111111111111有没有进来过");rnrn rn sdr.Close();rn if (temp=="yes")rn rn userTb.Text = "";rn pwdTb.Text = "";rn Response.Write("222222222222222有没有进来过");rn Response.Redirect("http://www.sina.com.cn");rn rn elsern rn Response.Write(" "); rn userTb.Text = "";rn pwdTb.Text = "";rn rn rn rnconn.Close();rnrn还有我<em>数据库</em>是在 服务器资源管理器-数据连接--(右击)创建新SQL Server<em>数据库</em> 里建的.不知在那里建对不对?
为什么加不了水印呢?
[code=csharp]rnstatic void Main(string[] args)rn rn MyFun(@"D:\imgs\gsyh_2014-01-01.xls_out.tif", @"D:\imgs\运营业务专用章.png", @"D:\imgs\new.tif");rn rnrnstatic void MyFun(string oldImgPath,string waterImgPath,string newImgPaht)rn rn System.Drawing.Image oldImg = System.Drawing.Image.FromFile(oldImgPath);rn System.Drawing.Image waterImg = System.Drawing.Image.FromFile(waterImgPath);rnrn Bitmap bm = new Bitmap(oldImg);rn Graphics g = Graphics.FromImage(bm);rn g.DrawImage(oldImg, 100, 100, waterImg.Width, waterImg.Height);rnrnrn oldImg.Save(newImgPaht);rn g.Dispose();rn oldImg.Dispose();rn rn[/code]rnrn生成的新图像,没看到水印啊,和旧图像一样。
为什么编译不了java文件呢?
请问这是什么原因:rnWebConstants.java文件:rnpackage WebRelease;rnrnpublic interface WebConstantsrnrn public static final String driverClass ="driverClass";rn// const userId is the user id to connect to databasern public static final String userId ="comm";rn// const passWd is the user password to connect to databasern public static final String passWd ="comm123";rn// const url is the url to connect to databasern public static final String url="jdbc:oracle:thin:@127.0.0.1:1521:win";rn public static final String selectType ="select";rn public static final String connection ="connection";rn public static final String connError ="conError";rnrnrnConnectionManager.java文件:rnpackage WebRelease;rnrnimport java.io.*;rnimport java.beans.*;rnimport java.util.*;rnimport java.sql.*;rnimport WebRelease.WebConstants;rnimport oracle.jdbc.driver.*;rnrnpublic class ConnectionManager implements WebConstantsrnrn private boolean debug = true;rn protected Connection con;rn protected DebugWriter writer;rn PropertyChangeSupport pcs;rnrn public ConnectionManager()rn rn pcs = new PropertyChangeSupport(this);rn writer = new DebugWriter();rn rnrn public void setDebug(String b)rn rn debug = b.equals("true");rn rnrnpublic void addPropertyChangeListener( PropertyChangeListener l)rn rn pcs.addPropertyChangeListener(l);rn rnrnpublic void removePropertyChangeListener(PropertyChangeListener l)rn rn pcs.removePropertyChangeListener(l);rn rnrn public void login()rn rn tryrn rn DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());rn Class.forName("oracle.jdbc.driver.OracleDriver");rn rn catch(Exception e)rn rn if(debug) writer.writeDebug("Error setting driver:"+e.getMessage());rn rn tryrn rn con = DriverManager.getConnection(url,userId,passWd);rn pcs.firePropertyChange(connection,null,con);rn if(debug)rn rn writer.writeDebug("connection succeded ! URL:"+url+"User:"+userId+rn "Pwd:"+passWd);rn rn rn catch(Exception e)rn rn pcs.firePropertyChange(connError,null,e);rn if(debug)rn rn writer.writeDebug("connection failed ! URL:"+url+"User:"+userId+rn "Pwd:"+passWd);rn rn rnrn rnrnrn编译时出现如下错误:rn# javac WebConstants.java ConnectionManager.java rnrnConnectionManager.java:16: cannot resolve symbolrnsymbol : class DebugWriter rnlocation: class WebRelease.ConnectionManagerrn protected DebugWriter writer;rn ^rnConnectionManager.java:22: cannot resolve symbolrnsymbol : class DebugWriter rnlocation: class WebRelease.ConnectionManagerrn writer = new DebugWriter();rn ^rn2 errorsrnrnprotected DebugWriter writer 是什么错误呢?rn
为什么会setitem 不了呢`?~
程序运行没有出错的提示,我写的语句如下:rnrndw_master2.setitem(i,"kcjd",0)rnrnwhy`~?~?~`
为什么加载不了位图图像呢?
为什么加载<em>不了</em>位图图像呢??rn创建了一些位图;rn且ID也进行了定义;rn为什么还是加载<em>不了</em>呢??
这个为什么删除不了呢?
#include rn#define N 5rnrnvoid main()rnrn int i,j;rn double num[N] = 23, 42, 67, 89, 91,search;rn //num[N] ;rnrn printf("\n 请您输入一个要从已知数组中删除的数:\n");rn scanf("%lf", &search);rn for(i=0;i
为什么插入不了数据呢
本人用DATABASE联interbase<em>数据库</em>,用query联DATABASE,用actionmanger的insert功能rnrn但是程序说是数据只读不能插入记录.rn为什么呢???rnrn郁闷中
Adobe Reader 9.3添加书签的方法下载
Adobe Reader 9.3添加书签的方法,本人亲测,绝对可用! 相关下载链接:[url=//download.csdn.net/download/medehao/2687765?utm_source=bbsseo]//download.csdn.net/download/medehao/2687765?utm_source=bbsseo[/url]
电路板排列问题-回溯法下载
采用回溯法解决电路板排列问题,参考:算法设计与分析 相关下载链接:[url=//download.csdn.net/download/z228135494/4991352?utm_source=bbsseo]//download.csdn.net/download/z228135494/4991352?utm_source=bbsseo[/url]
国嵌_嵌入式Linux培训班_绝大部分实验代码+手册+课件_13下载
1、国嵌的嵌入式Linux培训班绝大部分实验代码+手册+课件,设计Linux基础到Linux编程,linux内核到驱动,对于想入门嵌入式和刚入门的朋友,有比较大的参考价值! 2、资源大小总共600M,分14份上传,每份45M! 相关下载链接:[url=//download.csdn.net/download/pyc_2011/5066073?utm_source=bbsseo]//download.csdn.net/download/pyc_2011/5066073?utm_source=bbsseo[/url]
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件
我们是很有底线的