Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
1.11/5 (2 votes)
See more:
Hi i wonder if anyone can assist me.

we previously had a web page that was published . but now due to increase the database name was changed.

i have changed the name in the datasource in code behind but it still looks at the old database.
is there any other place where it must be changed as well? i have removed the code and redid it but it still looks at old database name.

the database name was changed from Credit_reject to REJECTS

the error is login failed for database Credit_reject

VB
Dim connections As String = "Data Source=INTRA1\INTRA;Initial Catalog=REJECTS;User ID=sa;Password=*******;Pooling=False"
       Dim mycon As New SqlConnection(connections)

       mycon.Open()
       Dim insrtcom As New SqlCommand
       insrtcom.CommandText = ("insert into CREDIT_REJECTS(Acc_Num, ACC_NAME,ORDERNUM,RCV_NO,TRAY_NO,SLIPNO,DATE,REASON,OTHER_REASON,OPERATOR) values (@Acc_Num,@ACC_NAME,@ORDERNUM,@RCV_NO,@TRAY_NO,@SLIPNO,@DATE,@REASON,@OTHER_REASON,@OPERATOR)")
       insrtcom.Parameters.AddWithValue("@Acc_Num", DropDownList1.SelectedItem.Text)
       insrtcom.Parameters.AddWithValue("@ACC_NAME", DropDownList1.SelectedValue)
       insrtcom.Parameters.AddWithValue("@ORDERNUM", TextBox6.Text)
       insrtcom.Parameters.AddWithValue("@RCV_NO", TextBox2.Text)
       insrtcom.Parameters.AddWithValue("@TRAY_NO", TextBox3.Text)
       insrtcom.Parameters.AddWithValue("@SLIPNO", TextBox5.Text)
       insrtcom.Parameters.AddWithValue("@DATE", lbldate.Text)
       insrtcom.Parameters.AddWithValue("@REASON", DropDownList2.SelectedItem.Text)
       insrtcom.Parameters.AddWithValue("@OTHER_REASON", TextBox4.Text)
       insrtcom.Parameters.AddWithValue("@OPERATOR", DropDownList3.SelectedValue)
       insrtcom.Connection = mycon
       insrtcom.ExecuteNonQuery()
       mycon.Close()
       mycon.Dispose()
       lblinserted.Text = " 1 Row Inserted"
Posted
Comments
ArunRajendra 22-Jul-13 7:20am    
Try after restarting your webserver. Aldo try to restart worker process asp_wp.exe. This you can do by restarting the application pool.
Member 9742322 22-Jul-13 7:31am    
hi i have not published after changing the datasource this is still in the testing phase. if i changed it in code behind should i change it anywhere else as well.
ArunRajendra 22-Jul-13 8:37am    
No
ZurdoDev 22-Jul-13 8:47am    
I doubt the error is in this code. The error is likely somewhere else.
Member 9742322 22-Jul-13 8:49am    
i have in the asp side 3 sqldatasource which i changed there and those work perfect.
i will redo the page and see if it resolves the error as i cant see why it it doing that
thank you for all the help

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900