Click here to Skip to main content
15,918,742 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionDSN for MS Access ODBC Driver Pin
Muhammad Gouda6-Feb-08 4:45
Muhammad Gouda6-Feb-08 4:45 
QuestionRe: DSN for MS Access ODBC Driver Pin
Vasudevan Deepak Kumar6-Feb-08 6:13
Vasudevan Deepak Kumar6-Feb-08 6:13 
Generalcreating a dll Pin
eyeseetee6-Feb-08 3:25
eyeseetee6-Feb-08 3:25 
GeneralRe: creating a dll Pin
Not Active6-Feb-08 4:07
mentorNot Active6-Feb-08 4:07 
GeneralRe: creating a dll Pin
eyeseetee6-Feb-08 5:00
eyeseetee6-Feb-08 5:00 
GeneralPlaying a mp3 file Pin
dptalt6-Feb-08 2:51
dptalt6-Feb-08 2:51 
AnswerRe: Playing a mp3 file Pin
Vasudevan Deepak Kumar6-Feb-08 2:56
Vasudevan Deepak Kumar6-Feb-08 2:56 
GeneralHelp with Return value Pin
Member 40654726-Feb-08 2:42
Member 40654726-Feb-08 2:42 
hello i have folowing function
VB
 Public Shared Function Save(ByVal myContactInfo As ContactInfo) As Integer
            Dim result As Integer = 0
            ' Using
            Dim myConnection As SqlConnection = New SqlConnection(AppConfiguration.ConnectionString)
            Try
                Dim myCommand As SqlCommand = New SqlCommand("JobsDb_ContactInfo_InsertUpdateSingleItem", myConnection)
                myCommand.CommandType = CommandType.StoredProcedure
                If myContactInfo.UserID = -1 Then
                    myCommand.Parameters.AddWithValue("@Userid", DBNull.Value)
                Else
                    myCommand.Parameters.AddWithValue("@Userid", myContactInfo.UserID)
                End If
                myCommand.Parameters.AddWithValue("@UserName", myContactInfo.UserName)
                myCommand.Parameters.AddWithValue("@Title", myContactInfo.Title)
                myCommand.Parameters.AddWithValue("@FirstName", myContactInfo.FirstName)
                myCommand.Parameters.AddWithValue("@LastName", myContactInfo.LastName)
                myCommand.Parameters.AddWithValue("@Email", myContactInfo.Email)
                If String.IsNullOrEmpty(myContactInfo.StreetAddress1) Then
                    myCommand.Parameters.AddWithValue("@StreetAddress1", DBNull.Value)
                Else
                    myCommand.Parameters.AddWithValue("@StreetAddress1", myContactInfo.StreetAddress1)
                End If

                If String.IsNullOrEmpty(myContactInfo.StreetAddress2) Then
                    myCommand.Parameters.AddWithValue("@StreetAddress2", DBNull.Value)
                Else
                    myCommand.Parameters.AddWithValue("@StreetAddress2", myContactInfo.StreetAddress2)
                End If
                If String.IsNullOrEmpty(myContactInfo.ZiporPost) Then
                    myCommand.Parameters.AddWithValue("@ZipOrPost", DBNull.Value)
                Else
                    myCommand.Parameters.AddWithValue("@ZipOrPost", myContactInfo.ZiporPost)
                End If
                myCommand.Parameters.AddWithValue("@CountryId", myContactInfo.CountryID)
                myCommand.Parameters.AddWithValue("@StateId", myContactInfo.StateID)
                myCommand.Parameters.AddWithValue("@city", myContactInfo.City)
                If String.IsNullOrEmpty(myContactInfo.PrimaryPhone) Then
                    myCommand.Parameters.AddWithValue("@PrimaryPhone", DBNull.Value)
                Else
                    myCommand.Parameters.AddWithValue("@PrimaryPhone", myContactInfo.PrimaryPhone)
                End If
                If String.IsNullOrEmpty(myContactInfo.SecondaryPhone) Then
                    myCommand.Parameters.AddWithValue("@SecondaryPhone", DBNull.Value)
                Else
                    myCommand.Parameters.AddWithValue("@SecondaryPhone", myContactInfo.SecondaryPhone)
                End If
                myCommand.Parameters.AddWithValue("@WorkStatus", myContactInfo.WorkStatus)
                myCommand.Parameters.AddWithValue("@SHMyName", myContactInfo.SHMyName)
                myCommand.Parameters.AddWithValue("@SHMyEmail", myContactInfo.SHMyEmail)
                myCommand.Parameters.AddWithValue("@SHMyPhones", myContactInfo.SHMyPhone)
                myCommand.Parameters.AddWithValue("@ActivityDate", myContactInfo.ActivityDate)

                Dim returnValue As DbParameter
                returnValue = myCommand.CreateParameter
                returnValue.Direction = ParameterDirection.ReturnValue
                myCommand.Parameters.Add(returnValue)
                myConnection.Open()
                myCommand.ExecuteNonQuery()
                result = Convert.ToInt32(returnValue.Value)
                myConnection.Close()
            Finally
                CType(myConnection, IDisposable).Dispose()
            End Try
            Return result
        End Function
and i want to get return value of user id which is main column and primary key with identity specification =yes
i want to get something like this
            
If Not (Profile.UserId = -1) Then
                myContactInfo.UserID = Profile.UserId

                [ContactInfoManager].Save(myContactInfo)
                [BandEManager].Save(myBandE)
                [DPManager].Save(mydp)
            Else
                Dim returnvalue As Integer = ContactInfoManager.Save(myContactInfo)
                Profile.UserId = returnvalue
                [BandEManager].Save(myBandE)
                [DPManager].Save(mydp)
            End If

but when i run the save function i get UserId=0 wich is supposed to be UserId of that contact info table in database...please can anyone help
thank you in advance
appu


modified 20-Apr-17 11:32am.

GeneralRe: Help with Return value Pin
Not Active6-Feb-08 4:09
mentorNot Active6-Feb-08 4:09 
GeneralRe: Help with Return value Pin
Member 40654726-Feb-08 4:50
Member 40654726-Feb-08 4:50 
QuestionWebPart and Authorization Pin
Littlefool6-Feb-08 2:25
Littlefool6-Feb-08 2:25 
Generalseekafile Pin
venky4566-Feb-08 2:13
venky4566-Feb-08 2:13 
Questionevent calendar help Pin
raj_code6-Feb-08 0:45
raj_code6-Feb-08 0:45 
AnswerRe: event calendar help Pin
Vasudevan Deepak Kumar6-Feb-08 1:29
Vasudevan Deepak Kumar6-Feb-08 1:29 
GeneralPopup window with no titlebar Pin
samerh6-Feb-08 0:33
samerh6-Feb-08 0:33 
AnswerRe: Popup window with no titlebar Pin
Vasudevan Deepak Kumar6-Feb-08 1:28
Vasudevan Deepak Kumar6-Feb-08 1:28 
GeneralCheck all checkboxes in gridview Java script Pin
samerh6-Feb-08 0:26
samerh6-Feb-08 0:26 
GeneralRe: Check all checkboxes in gridview Java script Pin
Prashant B. Lavate6-Feb-08 0:43
Prashant B. Lavate6-Feb-08 0:43 
Questionhow to work with Flv Plyar.... Pin
Prashant B. Lavate6-Feb-08 0:20
Prashant B. Lavate6-Feb-08 0:20 
AnswerRe: how to work with Flv Plyar.... Pin
Vasudevan Deepak Kumar6-Feb-08 1:30
Vasudevan Deepak Kumar6-Feb-08 1:30 
Generalupload file on server Pin
ashok kr yadav6-Feb-08 0:15
ashok kr yadav6-Feb-08 0:15 
GeneralRe: upload file on server Pin
N a v a n e e t h6-Feb-08 0:33
N a v a n e e t h6-Feb-08 0:33 
Generalpaging concept Pin
trilokharry5-Feb-08 23:57
trilokharry5-Feb-08 23:57 
GeneralRe: paging concept Pin
imsathy6-Feb-08 18:27
imsathy6-Feb-08 18:27 
GeneralFirefox Problem while calling method of object Pin
trinadh_t5-Feb-08 23:57
trinadh_t5-Feb-08 23:57 

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.