I'm with you there. In VB6, I never used databinding! I hated it and it was flaky. Now, however, .NET has made vast improvements with DataBinding! I've been able to Code Business Layers and UIs with very little code at all! Not only that, it's great having the ability to Map DataColumns to DataCommand Parameters and be able to use Stored Procs to update data. And it doesn't stop there, you can even get Values from the DB with "Output" Parameters!
I am working on the guestbook in VB.NET with SQL db. I have a database for registered users, there are names, surnames, and mainly paths to user-defined images, which they want them to be seen together with their comments.
I have two possibilities how to do it:
1)I will authentify the user with the user control, load the guestbook.aspx - I will get all data from table GUESTBOOK only, when user submits the form, I will get the ImagePath from db and save the name, comment, AND IMAGEPATH to db table GUESTBOOK. I think this way is faster during the guestbook.aspx load, but I have to save the same ImagePaths each time the user sends the comment.
2)I will authentify the user with the user control, load the guestbook.aspx - I will get the names and comments from table GUESTBOOK and ImagePaths based on usernames from USERS table. When user submits the form, I will only save the GUESTBOOK table, not more.
I've got a database, it's not set up with cascading delete, and I'd prefer it not be. Instead, I'd like to turn of foreign key checking when I delete all data from all the tables. Is there a way to delete all data without figuring out the correct delete order, by getting SQL Server to ignore the constraints ?
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
I am referencing the libraries from msado15.dll and retreiving data from an access database using visual C++. I have already connected succesfully to the DB, and can read data. I use the following command to retreive information from a particular field in the table:
my_String = _strdup((char*) ((_bstr_t)(pConnectRead->GetFields()->GetItem("nom_medico")->GetValue())) );
How do i write a boolean value to a field, once i have established connection to the DB and currently in the row of interest.
I am using the statement you provided:
pConnectRead->GetFields()->GetItem("nom_medico")->Value = false;
within a try-catch loop. but it jumps to the _com_error as soon as it executes this statement. Maybe i am giving the wrong premissions in the statement right before:
I've got a table (whith an index on the CarId field (IdentityIncrement). Now I'd like to write a stored procedure which inserts a new record into this table and returns the CarId of the newly generated record. But I don't know how to do this w/o using a SELECT after the INSERT. Can anyone pls. help?
Thanks in advance.
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
You need to make Access Table/Queries compatiable with SQL ANSI.
Go to Tools -> Options -> Table/Queries Tab
Now, check the "This database" checkbox under "SQL Server compatiable syntax" option on bottom right side.
Now, you would be able to run this query.
I have a problem. I need to update my database from a xml dataset file but it doesn't work.
1)I fill my dataset with the dataAdapter.
2)I change some data in my datagrid
3)I save my dataset with de writeXml method. ( this part is ok)
4)I fill my dataset with the xml file, readXml (this part is ok)
5) Update ( It doesn't work. my update command is ok and I have no error)
I also tried the getChange method, and saved the result into a dataset saved in xml format. The modified rows(from the dataset created with the getChange method) are insert in the database (not update).
Thr problem with this is that you need to save the XML using a "DiffGram" model. By default, this is not used in the WriteXML and when you Save the XML file and Read it back in, the DataSet thinks there are no changes to be updated. However, one last Quirk, you also need to save the Schema into a different file as well, since you cannot save both the Schema AND the DiffGram into one file.