Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Kako napraviti UPDATE query u asp.net-u?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Bluesmaster



Joined: 16 Nov 2007
Posts: 7

PostPosted: 20.11.2007 02:45    Post subject: Kako napraviti UPDATE query u asp.net-u? Add user to your forum ignore list Reply with quote

U Accessovoj bazi postoji samo jedna table 'tablica', jedan record i dva fields 'id' i 'sadrzaj'.
Zanima me gdje grijesim...

moj kod:

string putanja = Server.MapPath("baza.mdb");
string connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + putanja;
OleDbConnection conn = new OleDbConnection(connStr);
string sqlUpit = "UPDATE tablica SET sadrzaj = 'jagode' WHERE id = 1";
OleDbCommand cmd = new OleDbCommand(sqlUpit, conn);

conn.Open();
cmd.ExecuteNonQuery();
conn.Close();

ovo je greska koja mi se javi:

System.Data.OleDb.OleDbException: Operation must use an updateable query. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at web_forma.upis.gumb_ServerClick(Object sender, EventArgs e) in e:\inetpub\wwwroot\web_forma\upis.aspx.cs:line 65
Back to top
View user's profile Send private message Send e-mail
:cosmos:



Joined: 12 Sep 2003
Posts: 2098
Location: México

PostPosted: 20.11.2007 02:48    Post subject: Add user to your forum ignore list Reply with quote

evo sto kaze uncle google, usto, i kod errora se vidi sto bi moglo biti

http://www.dotnet247.com/247reference/msgs/49/245671.aspx
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=498377&SiteID=1
Back to top
View user's profile Send private message Send e-mail Visit poster's website Twitter profile
Moebius



Joined: 26 Jan 2004
Posts: 245
Location: zagreb

PostPosted: 20.11.2007 10:31    Post subject: Add user to your forum ignore list Reply with quote

vrlo vjerojatno nemas write permissions na bazu.
Back to top
View user's profile Send private message Visit poster's website
killa



Joined: 12 Sep 2003
Posts: 277
Location: zagreb

PostPosted: 20.11.2007 12:52    Post subject: Add user to your forum ignore list Reply with quote

nazovi hosting providera i zatraži read/write premisije na bazi ili na cijelom sajtu

_________________
[killa bee]
Back to top
View user's profile Send private message Visit poster's website
wxyzrusmir



Joined: 27 Jun 2005
Posts: 256
Location: Sarajevo

PostPosted: 20.11.2007 21:07    Post subject: Add user to your forum ignore list Reply with quote

read/write permisija

_________________
ideas are all that you need | www.ideaisall.com
brainstorming magazine | use the brain to get ideas | www.brainstorming.ba
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Bluesmaster



Joined: 16 Nov 2007
Posts: 7

PostPosted: 21.11.2007 01:20    Post subject: Add user to your forum ignore list Reply with quote

Hvala svima!
Puno ste mi pomogli!
Back to top
View user's profile Send private message Send e-mail
Ivan Markulin



Joined: 05 Jan 2008
Posts: 1
Location: Zagreb

PostPosted: 05.01.2008 21:09    Post subject: update query Add user to your forum ignore list Reply with quote

Probaj ovaj kod:
Sub Update(sender as Object, e as EventArgs)
Dim con As OleDbConnection
Dim cmd As OleDbCommand
Dim strSQL As String


con = New OleDbConnection ("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" & MapPath("baza.mdb"))
strSQL="Update tablica Set sadrzaj=? Where ID=1"
cmd=New OleDbCommand(strSQL, con)
cmd.Parameters.Add("@sadrzaj", "jagode")


con.Open()
cmd.ExecuteNonQuery()
con.Close()

End Sub

I stavi u page direktivu da ti je debug True kako bi u error poruci bolje vidi gdje je doslo do problema (<%@ Page Language = "VB" Debug = "True"%>)

pozdrav
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group