Updating functionality, possible security issue?

mdnewman007

Member
Joined
Apr 28, 2006
Messages
9
Programming Experience
1-3
I have, for years, been trying to figure out ADO.Net. I have never not had a problem with data updating. I will try what I can to modify data, but I can only read it... even if I create a new sql database seconds before trying to access and modify it all in the IDE Studio.

My current problems stems to every data access issue that comes up and I am curious if there is a potential security issue, or something else with my system configuration.

I have the 2005 server running on my laptop, with the Visual Studio express addition and the .net framework 2.0.50727.

I can do pretty much anything except for data changing. I have gotten about 10 different books and I can not figure it out as to why three different computers do not want to run anything that can update a database.

I use other peoples code to see if it will work, I use online tutorials shown on www.learnvisualstudio.net. I use learn visual basic .Net in 21 days, I use MCAD certification prep books. I have advanced ADO.Net connection books, and even some "for dummies" books. Nothing seems to want to let me modify data using the update commands for an SQL database.

I can create a database in the IDE, add new database using the wizards with the correct connection strings, look at the data in the database, but can not modify it at all. Even draggin over a dataset from the datasource window will not properly function.

I have been drilling a screwdriver into my head trying to figure out why I can not modify data under anyone's guidelines...

If anyone has any ideas as to how I can modify my computer to have data modification I would surely love it. My brain has imploded, exploded, and been scrambled for over a year now and I'm about ready to have some kind of a nervous breakdown... I feel I should be certified by now.

Anyone have anything, please, just let me know and I'll try it out.
 
Well, if you're up to reading two more things, check out the ADO.NET tutorials in my sig....

If you're still swimming after that... try posting the code you're having issues with (do you get errors, or does nothing happen, or what?).... and we'll see if we can give more detailed help.

-tg
 
Well...
VB.NET:
Inherits system.Windows.Forms.Form
Private Const MyConnString as String = "data source=.\SQLEXPRESS;integrated Security=SSPI;AttachDBFileName =c:\Documents and settings\Matthew Newman\My Documents\Visual Studio 2005\Projects\MyCompany.mdf;User Instance=True"
 
Private sub LoadProducts_Click(byval sender as object, byval e as eventargs) handles LoadProducts.click
 
Dim myConn as new SqlConnection(MyConnString)
Dim SelectProducts as new SQLCommand("Select * from Customers)
Dim MyAdapter as new SQLDataAdapter(SelectProducts)
 
MyAdapter.SelectCommand.Connection = MyConn
 
dim ds as new Dataset
 
MyAdapter.fill(ds, "Customers")
 
ProductList.Datasource = ds
ProductList.DataMember = "Customers"
 
end sub

End result on this ... A connection opened, but I can not change the data in the database when I add update commands.
Also, I have used the video lessons 8 and 9 from here >> http://msdn.microsoft.com/vstudio/express/vb/learning/

I have done them step by step and can access the databases, but not write to them from the applications.

I can establish connections... just not modify the data in the databases using updates after populating the dataset with new information... it can get sent to the database, but not update.
 
Okay, I re-installed my OS a couple days ago and seems that I can at-least get a simple "DELETE FROM Customere WHERE CustomerID=1" SQL statement to work.

I guess I have been going at this for so long my brain is starting to frikken pop.

Thanks for the help, I'll see if I can go from basics... none of my books are helping, but the SDK help seems to have a couple good things in it I can cut from.

I plugged in a second button and whipped up some simple delete code to get this to work...

Dim myConn...
Dim MyCommand...
MyCommand.CommandType =
MyCommand.CommandText = SqlStatement

Open
NonQuery
Close

Thanks, but I still fear my head has imminent explosion written all over it. I can get stuff to work for a few attemps per couple of months before something else goes ape.

Thank again,
-M
 
Also, I don't know if it helped, but I cut out every bit of security on my system, wiped out internet access from the machine so nothing goes bizurk... and turned off any type of application that would contradict with updates from one program to another... In the new installation of my OS, it's a very basic system... IIS, SQL Server 2005, Access, VB.Net, Framework 2.0.50727, VS.Net IDE... that's it. Everything else was stripped off the system, no other programs installed, nothing else configured.
 
You still didn't answer an important question...
Are you getting errors? Or are you looking at the data from the back end to see if it updated?

-tg
 
Back
Top