Hello out there ? i have one question rather a strange one

i have two tables say admission and attendance with different fields however admn id , name are the fileds common to both of them

when i add my data in admission table (via form) can i at the same time add the data to attendance table ?? ie .. when i click on save button on admission form will the admn , name fileds will also be entered in the attendance database table??

can it be done ? if yes how ?? can we bind a textbox with 2 data bindings?
i am binding thru properties n rest coding....plz tell me how to do./..

just run your commandtext.Insert or whatever it is (i am going by memory) and insert into both tables. No?

Lee

nah...re.....its nt wrkng! ne other solutions ? ne more appropriate solns?

just run your commandtext.Insert or whatever it is (i am going by memory) and insert into both tables. No?

Lee

yes, you just do twice inserting.

>>nah...re.....its nt wrkng! ne other solutions ? ne more appropriate solns?
lee was give the answer. Have u tried it?post your code.

yes, you just do twice inserting.

But how will i insert directly ? i have no form for attendance...directly update into the table ??? how can i do this ??? i have not designed any form for the same...i want the admission table values (for the specific rows common in attendance table ) to be also inserted in the attendance table.

2) Ne idea how to clear the Selected item in combo box? ie...when i click on next...my all text box gets clear but combo box values for the previous entry remains intact.....help me:)

1. Tables field. give the admission and attendance table field. ()
2. You want to all clear item on combo box (empty) or you want to clear selected (ex : ---select your choice---) ??

selected choise should be erased ...

*Very strange error comes sometimes while i try to enter data in database which says.....
String or Binary data would be truncated !
Whats this error ? its a very common error i cant figure it out.whts the problem....its cums only sumtimes not always...why so ???

reply soon !

1. Tables field. give the admission and attendance table field. ()
2. You want to all clear item on combo box (empty) or you want to clear selected (ex : ---select your choice---) ??

>> *Very strange error comes sometimes while i try to enter data in database which says.....
String or Binary data would be truncated !

this error came up if length of your input more longer than your data type length in database.
Ex: In your database
name -> type : String, Length : 5
but when you input data, its more than 5 character. so it would be truncated.
So, if you input Daniweb it would be -> Daniw.

Okie....i will try...but i have given enuf length for each field sufficiently....ne ways thanks a lot.....u havent yet replied for the combo box question...hp u ll help me out soon

>> *Very strange error comes sometimes while i try to enter data in database which says.....
String or Binary data would be truncated !

this error came up if length of your input more longer than your data type length in database.
Ex: In your database
name -> type : String, Length : 5
but when you input data, its more than 5 character. so it would be truncated.
So, if you input Daniweb it would be -> Daniw.

]Okie....i will try...but i have given enuf length for each field sufficiently....ne ways thanks a lot.....u havent yet replied for the combo box question...hp u ll help me out soon

>> selected choise should be erased ...
This following code will removed selected item on combo box after you click on button 1.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ComboBox1.Items.RemoveAt(ComboBox1.SelectedIndex)
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.