Click here to Skip to main content
16,006,013 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Open popup window on selectedIndexChange of "asp:dropdownlist" Pin
deep725-Jul-07 0:10
deep725-Jul-07 0:10 
Questionhow to add record to next row in datagrid Pin
rahul.net1124-Jul-07 23:19
rahul.net1124-Jul-07 23:19 
GeneralRe: how to add record to next row in datagrid Pin
BasharatAli24-Jul-07 23:58
BasharatAli24-Jul-07 23:58 
GeneralRe: how to add record to next row in datagrid Pin
rahul.net1125-Jul-07 0:28
rahul.net1125-Jul-07 0:28 
AnswerRe: how to add record to next row in datagrid Pin
BasharatAli25-Jul-07 0:52
BasharatAli25-Jul-07 0:52 
GeneralRe: how to add record to next row in datagrid Pin
rahul.net1125-Jul-07 2:24
rahul.net1125-Jul-07 2:24 
QuestionIntresting Task- But Very urgent Pin
sharruom24-Jul-07 23:18
sharruom24-Jul-07 23:18 
QuestionError in updating date Pin
n_gchaitra24-Jul-07 23:09
n_gchaitra24-Jul-07 23:09 
I have the following function writen in asp.net with vb script. when click the update button everthing is getting updated except "date" I tried to update using date.parse also but no use. The same code was woking fine previous say a week back. I have not made any changes also. But I am not finding any reasons for this. this is happening whereever i have used date. Insertion or updation of date and searching based on date is not working.



Function update()
Dim flag As Boolean
flag = False
Dim tran As SqlClient.SqlTransaction
Dim a As String
a = txtexpdate.text
Dim d As Date = Date.parse(a)


If txtremark.Text.Trim = "" Or lblcustname.Text.Trim = "" Or txtcustdrno.Text.Trim = "" Or txtbore.Text.Trim = "" Or txtstroke.Text.Trim = "" Or txtapplication.Text.Trim = "" Or txtrod.Text.Trim = "" Or txtpress.Text.Trim = "" Or txteqpmodel.Text.Trim = "" Then
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Fields can not be left blank !"
Exit Function

ElseIf IsNumeric(txtbore.Text.Trim) = False Or IsNumeric(txtstroke.Text.Trim) = False Or IsNumeric(txtrod.Text.Trim) = False Or IsNumeric(txtpress.Text.Trim) = False Then
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Bore,stroke,rod and working pressure should have numeric value !"
Exit Function

Else
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
Dim comm As New SqlCommand()
comm = dbconn.CreateCommand
tran = dbconn.BeginTransaction
comm.Transaction = tran

Try
comm.CommandText = "update D_proposal set cust_drw_no='" & txtcustdrno.Text.Trim & "',cust_name='" & lblcustname.Text.Trim & "',typ_cyl='" & txttypcyl.Text.Trim & "',cushioning='" & txtcush.Text.Trim & "',bore='" & txtbore.Text.Trim & "',stroke='" & txtstroke.Text.Trim & "',application='" & txtapplication.Text.Trim & "',category='" & txtcat.Text.Trim & "',sada='" & txtsada.Text.Trim & "',rod='" & txtrod.Text.Trim & "',wrk_press='" & txtpress.Text.Trim & "',eqp_mdl='" & txteqpmodel.Text.Trim & "',mounting='" & txtmounting.Text.Trim & "'where pno='" & lblpno.Text.Trim & "'"
comm.ExecuteNonQuery()
'comm.CommandText = "update D_task_det set associate='" & txtassociate.Text.Trim & "',exp_date='" & txtexpdate.Text.Trim & "',remark='" & Replace(txtremark.Text.Trim, "'", "''") & "' where pno='" & lblpno.Text.Trim & "'and task='" & lbltask.Text.Trim & "'and leader='" & txtleader.Text.Trim & "'and revision='" & txtrevista.Text.Trim & "'and reassign='" & txtreassigsta.Text.Trim & "'and hold='" & txtholdsta.Text.Trim & "'"
comm.CommandText = "update D_task_det set associate='" & txtassociate.Text.Trim & "',exp_date='" & d & "',remark='" & Replace(txtremark.Text.Trim, "'", "''") & "' where pno='" & lblpno.Text.Trim & "'and task='" & lbltask.Text.Trim & "'and leader='" & txtleader.Text.Trim & "'and revision='" & txtrevista.Text.Trim & "'and reassign='" & txtreassigsta.Text.Trim & "'and hold='" & txtholdsta.Text.Trim & "'"
comm.ExecuteNonQuery()
tran.Commit()
flag = True
lblstatus.Visible = True
lblstatus.ForeColor = Color.Green
lblstatus.Text = "Successfully updated !"
Catch ex As Exception
tran.Rollback()
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Transaction failed !" '+ ex.ToString
Finally
comm.Dispose()
dbconn.Close()
End Try
Return flag
End If
End Function

Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
update()
End Sub

Chaitra N

AnswerRe: Error in updating date Pin
N a v a n e e t h25-Jul-07 1:28
N a v a n e e t h25-Jul-07 1:28 
GeneralRe: Error in updating date Pin
n_gchaitra27-Jul-07 0:29
n_gchaitra27-Jul-07 0:29 
Questiononline gaming project Pin
purvi barot24-Jul-07 22:45
purvi barot24-Jul-07 22:45 
AnswerRe: online gaming project Pin
Edwin Syarief25-Jul-07 22:37
Edwin Syarief25-Jul-07 22:37 
QuestionDisable all textbox & window.open problem Pin
J Liang24-Jul-07 22:38
J Liang24-Jul-07 22:38 
AnswerRe: Disable all textbox & window.open problem Pin
Red_Wizard_Shot_The_Food24-Jul-07 22:59
Red_Wizard_Shot_The_Food24-Jul-07 22:59 
GeneralRe: Disable all textbox & window.open problem Pin
J Liang25-Jul-07 18:07
J Liang25-Jul-07 18:07 
GeneralRe: Disable all textbox & window.open problem Pin
Red_Wizard_Shot_The_Food25-Jul-07 22:21
Red_Wizard_Shot_The_Food25-Jul-07 22:21 
AnswerRe: Disable all textbox & window.open problem Pin
Arindam Tewary24-Jul-07 23:04
professionalArindam Tewary24-Jul-07 23:04 
GeneralRe: Disable all textbox & window.open problem Pin
J Liang25-Jul-07 18:10
J Liang25-Jul-07 18:10 
QuestionBest way to generate and wire-up events for dynamic controls? Pin
Red_Wizard_Shot_The_Food24-Jul-07 22:36
Red_Wizard_Shot_The_Food24-Jul-07 22:36 
QuestionUser.Identity.name Pin
isaii24-Jul-07 22:35
isaii24-Jul-07 22:35 
GeneralRe: User.Identity.name Pin
BasharatAli24-Jul-07 23:42
BasharatAli24-Jul-07 23:42 
Questionhow to use scrolling in grid view Pin
Piyush Vardhan Singh24-Jul-07 21:18
Piyush Vardhan Singh24-Jul-07 21:18 
AnswerRe: how to use scrolling in grid view Pin
BasharatAli24-Jul-07 23:38
BasharatAli24-Jul-07 23:38 
GeneralRe: how to use scrolling in grid view Pin
Piyush Vardhan Singh25-Jul-07 2:04
Piyush Vardhan Singh25-Jul-07 2:04 
Questionradchart labeles Pin
devsam24-Jul-07 20:44
devsam24-Jul-07 20:44 

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.