tags:

views:

28

answers:

2

I need to add some common details in more than two tables.

ugad = "INSERT INTO Ugadmissiontable(Ugname,Ugdob,Uggender) 

this adds the info to Ugadmissiontable

And i need to add the some of the datas into department details

    ugad = "INSERT INTO" & dept 
            & "(Ugname,Ugdob,Uggender,Ugage,Ugdept,Ugcoursejoined)"

So i have stored the Department (from drop down list box) and assigned it to Dept. So i guess dept would have Csc if i choose csc and commerce if i hoose commerce.

When I checked with breakpoint it s workin. Datas are added perfectly. But they are not visible in that respective table

A: 

If the data are added to the table and then not displayed in the web page, it sounds like perhaps you are using a DataTable object and not refreshing the data in your code after you add the data to the SQL table.

If you perform a SELECT query to load your data into a DataTable and then execute an INSERT to add new data; perform the SELECT query again to reload your data into the DataTable; you will then see the new data.

Rice Flour Cookies
A: 

+1 about the sql injection attack. Generally speaking, constructing SQL commands like this bad practice. Look into "parameterized queries" for details on better ways to handle this.

But, given what you've posted, one thing to check is the command

"INSERT INTO" & dept & "(blah blah blah"

There's no space after INTO before the ", so your actual command could end up being

INSERT INTOdeptwhatever(blah blah blah)

which would be invalid SQL

drventure