Click here to Skip to main content
15,914,400 members
Home / Discussions / Database
   

Database

 
AnswerRe: MD5 in SQL Server 2000? Pin
Mike Dimmick19-Aug-03 5:02
Mike Dimmick19-Aug-03 5:02 
GeneralADO :VARIANY :Binarry Array Pin
Fad B17-Aug-03 21:52
Fad B17-Aug-03 21:52 
GeneralNoob sql Pin
Snyp17-Aug-03 4:59
Snyp17-Aug-03 4:59 
GeneralRe: Noob sql Pin
Rein Hillmann17-Aug-03 21:24
Rein Hillmann17-Aug-03 21:24 
GeneralRe: Noob sql Pin
Jeremy Oldham18-Aug-03 2:12
Jeremy Oldham18-Aug-03 2:12 
GeneralRe: Noob sql Pin
Snyp18-Aug-03 3:10
Snyp18-Aug-03 3:10 
GeneralPrimaryKey problem Pin
Hovik Melkomian17-Aug-03 3:03
Hovik Melkomian17-Aug-03 3:03 
GeneralC# - Help with preferred method to add a new row Pin
work_to_live16-Aug-03 13:05
work_to_live16-Aug-03 13:05 
Just starting to play around with database access in dotNET. I've run through a number of tutorials, and reviewed a number of articles on this web site. All was well and good until I tried to do something on my own... Uh Oh...

I created a simple relational database with the following tables...

Table - PhoneNumber
PhoneNumber_ID
PhoneNumber
PhoneNumberTypeID
PersonID

Table - PhoneNumberType
PhoneNumberType_ID
PhoneNumberType

Table - Person
Person_ID
FirstName
LastName

I threw some data in the PhoneNumberType and Person tables, and then wanted to see if I could create a form to add entries to the PhoneNumber table.

I added two comboboxes to the form, and bound them to datasets filled with the contents of PhoneNumberType and Person tables. The valuemember of the comboboxes is the ***_ID column of the selected row in the combobox. That's working fine.

I added a textbox to the form for the phone number.

So, I have all the elements necessary to add a new row to the PhoneNumber table, but I'm not sure of the most efficient method of performing the insert. After poking around on the internet for a while, it looks like there might be two options avaliable to me (there are probably more)...

1) Create a DataAdapter for the PhoneNumber table, then create and fill a dataset with all the phone numbers in the PhoneNumber table. Add the new row and then update the database with the new dataset (need to figure out how to do that). This seems like overkill for this simple function.

2) Create an SQLCommand and execute it with the new row values. I vaguely remember seeing an article that discussed using ?'s in the SQL command, and then filling in the parameters afterwards, but I can't seem to find it again.

Is either of these the preferred approach, or is there another approach I might consider.

Thanks... whew that was a mouthful.
GeneralRe: C# - Help with preferred method to add a new row Pin
work_to_live16-Aug-03 13:50
work_to_live16-Aug-03 13:50 
GeneraldataSet row position Pin
Hovik Melkomian16-Aug-03 5:52
Hovik Melkomian16-Aug-03 5:52 
GeneralDEPLOYMENT Pin
eggie515-Aug-03 22:56
eggie515-Aug-03 22:56 
GeneralDatagrid Pin
kornstyle14-Aug-03 7:31
kornstyle14-Aug-03 7:31 
GeneralRe: Datagrid Pin
Jeff Martin14-Aug-03 7:53
Jeff Martin14-Aug-03 7:53 
GeneralRe: Datagrid Pin
kornstyle14-Aug-03 8:08
kornstyle14-Aug-03 8:08 
GeneralRe: Datagrid Pin
kornstyle14-Aug-03 8:10
kornstyle14-Aug-03 8:10 
GeneralRe: Datagrid Pin
Jeff Martin14-Aug-03 9:26
Jeff Martin14-Aug-03 9:26 
GeneralRe: Datagrid Pin
kornstyle14-Aug-03 9:37
kornstyle14-Aug-03 9:37 
GeneralRe: Datagrid Pin
kornstyle14-Aug-03 9:43
kornstyle14-Aug-03 9:43 
QuestionNETTable creation through ADO.NET? Pin
Dr Herbie14-Aug-03 5:55
Dr Herbie14-Aug-03 5:55 
AnswerRe: NETTable creation through ADO.NET? Pin
Marcel Härry25-Aug-03 11:48
Marcel Härry25-Aug-03 11:48 
GeneralRe: NETTable creation through ADO.NET? Pin
Dr Herbie26-Aug-03 9:27
Dr Herbie26-Aug-03 9:27 
QuestionRobust Tool for creating Excel Spreadsheets from Oracle tables? Pin
dratti14-Aug-03 3:51
dratti14-Aug-03 3:51 
AnswerRe: Robust Tool for creating Excel Spreadsheets from Oracle tables? Pin
Markk14-Aug-03 8:51
Markk14-Aug-03 8:51 
GeneralRe: Robust Tool for creating Excel Spreadsheets from Oracle tables? Pin
dratti14-Aug-03 9:05
dratti14-Aug-03 9:05 
QuestionSQL Server 2000 Enterprise Manager? Pin
Jason Weibel13-Aug-03 11:29
Jason Weibel13-Aug-03 11:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.