User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 373,378 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,682 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 2791 | Replies: 140
Reply
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Insert to DB & View Results on Different Page

  #31  
Feb 19th, 2008
Ah blah.

Is ContactID an auto-increment, IDENTITY field? It should return the ID that was created.
Reply With Quote  
Join Date: Feb 2008
Location: Va Beach
Posts: 179
Reputation: foundsheep is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
foundsheep's Avatar
foundsheep foundsheep is offline Offline
Junior Poster

Re: Insert to DB & View Results on Different Page

  #32  
Feb 19th, 2008
I got rid of the contactID field yesterday when we were fixing the updating multiple tables.
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Insert to DB & View Results on Different Page

  #33  
Feb 19th, 2008
oh hmm, let me look at the db design again. I'll get back to you in a second.
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Insert to DB & View Results on Different Page

  #34  
Feb 19th, 2008
Alright quick question.

Is each company allowed to have more than 1 contact? If so, you need the ContactID field back in there with an auto-increment. Make it the primary.

If not, then let me know and I'll give you updated code.
Reply With Quote  
Join Date: Feb 2008
Location: Va Beach
Posts: 179
Reputation: foundsheep is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
foundsheep's Avatar
foundsheep foundsheep is offline Offline
Junior Poster

Re: Insert to DB & View Results on Different Page

  #35  
Feb 19th, 2008
Yes, each company can have multiple contacts.
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Insert to DB & View Results on Different Page

  #36  
Feb 19th, 2008
Ok, add the new column ContactID with the IDENTITY and auto increment, set it Primary:

ALTER TABLE Contacts ADD ContactID int IDENTITY(1,1) PRIMARY KEY

the IDENTITY(#,#): First number is the starting number. Start at 1000, increment by 5:
IDENTITY(1000,5)
Reply With Quote  
Join Date: Feb 2008
Location: Va Beach
Posts: 179
Reputation: foundsheep is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
foundsheep's Avatar
foundsheep foundsheep is offline Offline
Junior Poster

Re: Insert to DB & View Results on Different Page

  #37  
Feb 19th, 2008
I got that done. I"m using SQL Server Management Express Studio. So, I just did it in design mode.
Reply With Quote  
Join Date: Feb 2008
Location: Va Beach
Posts: 179
Reputation: foundsheep is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
foundsheep's Avatar
foundsheep foundsheep is offline Offline
Junior Poster

Re: Insert to DB & View Results on Different Page

  #38  
Feb 19th, 2008
Ok, it inserted the record with no errors but it did not populate the ticket fields.
Reply With Quote  
Join Date: Sep 2007
Posts: 1,054
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 61
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: Insert to DB & View Results on Different Page

  #39  
Feb 19th, 2008
Yeah I misspelled something in this line. Try it again:
if Not cusID Is Nothing and Not conID Is Nothing and Len(cusID) > 1 and Len(conID) > 1 then
Reply With Quote  
Join Date: Feb 2008
Location: Va Beach
Posts: 179
Reputation: foundsheep is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
foundsheep's Avatar
foundsheep foundsheep is offline Offline
Junior Poster

Re: Insert to DB & View Results on Different Page

  #40  
Feb 19th, 2008
Still nothing ...

I never put this anywhere. Is it supposed to go somewhere?

Dim cusID As String = Trim(Request.QueryString("cusID"))
Dim conID As String = Trim(Request.QueryString("conID"))
DropDownList1.Items.FindByValue(cusID).Selected = True
Dim eventarg As New EventArgs
Call DropDownList1_SelectedIndexChanged(DropDownList1, eventarg.Empty)
DropDownList2.Items.FindByValue(conID).Selected = True
eventarg = New EventArgs
Call DropDownList2_SelectedIndexChanged(DropDownList2, eventarg.Empty)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 3:12 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC