|
owww noo!!! another error occured! it is just the same as the one i made but why is this killing me
this is the error!
Exception Details: System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
is it good if i write it like this??
cmd.CommandText = "INSERT tblMembers(Name, Surname) VALUES (@value1, @value2)"
cmd.Parameters.Add("@value1", firstValue)
cmd.Parameters.Add("@value2", secondValue)
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Right Now I have this code:
Private Sub add()
Dim firstvalue As String = txtName.Text
Dim secondvalue As String = txtSurname.Text
Dim conn As OleDbConnection = New OleDbConnection(strConnection)
Dim cmd As OleDbCommand = New OleDbCommand
cmd.Connection = conn
cmd.CommandText = "INSERT Into tblMembers(Name, Surname) VALUES (?,?)"
cmd.Parameters.Add("Name", firstvalue)
cmd.Parameters.Add("Surname", secondvalue)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
End Sub
But an error is occuring telling me this:
Exception Details: System.Data.OleDb.OleDbException: Operation must use an updateable query.
What do you thing this is??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
I've never come across this exception message before, so I'm guessing that it is becuase Access does not understand named parameters. So remove the parameter name. i.e.
cmd.Parameters.Add(firstValue)
cmd.Parameters.Add(secondValue)
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
This comes up now:
Exception Details: System.InvalidCastException: The OleDbParameterCollection only accepts non-null OleDbParameter type objects, not String objects.
I am so sorry i am giving you a little trouble my friend! but right now i am searching for any help i can find! because i have stucked. and this is my final project of the school
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
ADY007 wrote: The OleDbParameterCollection only accepts non-null OleDbParameter type objects
Of course, The MSDN documentation for OleDbCommand[^] confirms that.
Because Access uses positioned parameters rather than named parameters I thought you didn't need the name. Apparently, according to the documentation I linked to above, you do. Anyway, the docs above should give you the help you need to get going again.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
The error i found what was the problem!!! whoever got this error:
the apdateable error .. go to Tool, Folder Options, View Tab and then uncheck the last one which tells you: Use Simple FIle Sharing. Uncheck it. then go to database file and right click on it, properties. then go to security tab and make write allowed!!! for all users!! then you can use the database to write in it. have fun!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
ADY007 wrote: make write allowed!!! for all users!!
And blow a great big security hole through your computer!
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Hai everyone,
May I know how to update a cookie using VB.NET. I received a message saying 403 Forbidden when I request for a web page programatically and I found on the web that it is because the cookie is not updated, sadly that person didn't specified how to do it in coding wise. Thank you.
-J Liang-
|
|
|
|
|
When you say that you request a page programatically, do you mean that you are using something like HttpWebRequest to get the page? In that case you have to handle the cookes yourself. If one response contains cookies, you have to send those along in the next request.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa, thanks for the speedy reply. Yes, you are right, I am using HttpWebRequest to get the page. This is my first time dealing with cookies, can you let me know what's the syntax to send the cookies? I'd added the cookies in the container CookieC.Add(LoginRes.Cookies) and when it reaches this line LoginRes = LoginReq.GetResponse(), the error message pops out, I guess here is where I should send the cookies again.
Thanks
-J Liang-
|
|
|
|
|
Ok, I just realized how to do it, so I guess I better post it here. Before the line
LoginRes = LoginReq.GetResponse()
I put
LoginReq = Net.WebRequest.Create(domain & "menu.php")
LoginReq.CookieContainer = CookieC
to send the cookie again that is to fill up the container again, so it became
LoginRes = LoginReq.GetResponse()
LoginReq = Net.WebRequest.Create(domain & "menu.php")
LoginReq.CookieContainer = CookieC
And it works, the page is being loaded, thanks for the idea, Guffa
-J Liang-
|
|
|
|
|
i need help with the simplest code possible that will disable the Alt key & the Windows key
cheers in advance
|
|
|
|
|
what is the use oops implementing in .net programming
|
|
|
|
|
"Oops" is something you say when your programming mistakes causes some kind of damage, for an example accidently erases the contents of a database table. Oops should preferably not be implemented at all.
What I think that you mean is OOP, object oriented programming[^].
The .NET framework is an object oriented platform, so the programming languages used with .NET is object oriented.
---
b { font-weight: normal; }
|
|
|
|
|
how many class library namespaces available in .net? what r they
|
|
|
|
|
hi
hope this will help you
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/cpref_start.asp
Tamimi - Code
|
|
|
|
|
Well, I sincerely hope that you are joking. If you are not, then the number of Namespaces/Classes/Assemblies available is pretty big. And, if you want to list them, the best approach would be opening Visual Studio and hitting F2 to open the Object Browser....
Yuvi Panda T
15 Year old Microsoft Student Partner
Blogs at : http://yuvipanda.blogspot.com
|
|
|
|
|
iam so glad that you are know the answer
Tamimi - Code
|
|
|
|
|
what is the main difference between vb and vb.net?
how vb.net is best than vb.
|
|
|
|
|
|
hi everybody i have a listview and i want that i select a item in the listview and then a clicked a button it swap with its upper item means if i cselect fourth item and click button then 4th and 3rd itrm interxchange,If anybody knows please help me,
Thanks
|
|
|
|
|
I am just wonder if I can know if a file has been copied from a while.
I mean we can trace if a file was changed or renamed or deleted ... but can we know if the file has been copied
Tamimi - Code
|
|
|
|
|
hi everybody
I want to add a button as one of the column in datagrid.if anybody know how to add button in datagrid please help me its urgent
Thanks
Thomas
|
|
|
|
|
Hi,
This Ravi.In my application I'm using a VB6.0 Dll and the application is working properly.The problem is when i am copying the application to another system the Dlls are not found in that.here again i'm putting the dlls in System32 folder and getting the dll.can any one give the solution of how to copy my application to another system without again referencing to the dll.Thank you
-regards
ravi
G Ravi kumar Reddy
Software Engineer
Multywave Technologies
|
|
|
|