Click here to Skip to main content
15,913,587 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to delete file forcefully..... Pin
KRathor10-Jul-05 4:49
KRathor10-Jul-05 4:49 
AnswerRe: How to delete file forcefully..... Pin
KaptinKrunch10-Jul-05 7:08
KaptinKrunch10-Jul-05 7:08 
GeneralRe: How to delete file forcefully..... Pin
Anonymous10-Jul-05 19:04
Anonymous10-Jul-05 19:04 
GeneralRe: How to delete file forcefully..... Pin
rwestgraham10-Jul-05 21:28
rwestgraham10-Jul-05 21:28 
GeneralRe: How to delete file forcefully..... Pin
Dave Kreskowiak11-Jul-05 1:52
mveDave Kreskowiak11-Jul-05 1:52 
GeneralDatagrid will not update Pin
erikkl200010-Jul-05 4:18
erikkl200010-Jul-05 4:18 
GeneralRe: Datagrid will not update Pin
KaptinKrunch10-Jul-05 7:04
KaptinKrunch10-Jul-05 7:04 
GeneralRe: Datagrid will not update Pin
erikkl200010-Jul-05 7:43
erikkl200010-Jul-05 7:43 
i have restructured my code starting the cell index at (1) because of the edit button in the first cell. Now i am receive this error message.
I am not sure if this will help you any but my grid is displaying double for some reason. I have not had trouble with populating datalist and grids untill now with the edit situation and i have been on thid for 2 days, Making me loco Frown | :(

any suggestions at all to what i am doing wrong here... I WILL POST MY CODE AGAIN



Server Error in '/DataBaseUpdate' Application.
--------------------------------------------------------------------------------

Specified argument was out of the range of valid values. Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index

Source Error:


Line 72: 'ID'S
Line 73: Dim IDProductRestrictions As Integer = CType(e.Item.Cells(1).Controls(0), TextBox).Text
Line 74: Dim IDProduct As Integer = CType(e.Item.Cells(2).Controls(0), TextBox).Text
Line 75: 'ID'S
Line 76: Dim MaxiumWidth As String = CType(e.Item.Cells(3).Controls(0), TextBox).Text

====================Update============================================

Sub dgProducts_Update(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
'
'Read in the values of the updated row
'ID'S
Dim IDProductRestrictions As Integer = CType(e.Item.Cells(1).Controls(0), TextBox).Text
Dim IDProduct As Integer = CType(e.Item.Cells(2).Controls(0), TextBox).Text
'ID'S
Dim MaxiumWidth As String = CType(e.Item.Cells(3).Controls(0), TextBox).Text
Dim MaxiumLength As String = CType(e.Item.Cells(4).Controls(0), TextBox).Text
Dim MinimumWidthForLiftTilt As String = CType(e.Item.Cells(5).Controls(0), TextBox).Text
Dim InsideMount As String = CType(e.Item.Cells(6).Controls(0), TextBox).Text
Dim OutsideMount As String = CType(e.Item.Cells(7).Controls(0), TextBox).Text
Dim ControlTilt As String = CType(e.Item.Cells(8).Controls(0), TextBox).Text
Dim StackingFormulas As String = CType(e.Item.Cells(9).Controls(0), TextBox).Text
Dim RestrictFive As String = CType(e.Item.Cells(10).Controls(0), TextBox).Text
Dim RestrictSix As String = CType(e.Item.Cells(11).Controls(0), TextBox).Text
Dim RestrictSeven As String = CType(e.Item.Cells(12).Controls(0), TextBox).Text
Dim RestrictEight As String = CType(e.Item.Cells(13).Controls(0), TextBox).Text
Dim RestrictNine As String = CType(e.Item.Cells(14).Controls(0), TextBox).Text
Dim RestrictTen As String = CType(e.Item.Cells(15).Controls(0), TextBox).Text
Dim RestrictEleven As String = CType(e.Item.Cells(16).Controls(0), TextBox).Text
Dim RestrictTwelve As String = CType(e.Item.Cells(17).Controls(0), TextBox).Text
'
'Get the connection
'
Dim cnn As New SqlConnection(ConfigurationSettings.AppSettings("cnn"))
cnn.Open()
'
'Set the command
'
Dim myCommand As New SqlCommand("SprocInsertProductRestrictive", cnn)
myCommand.CommandType = CommandType.StoredProcedure
'
'Add Parameters to the SQL query
'
Dim paramIDProductRestrictions As SqlParameter = New SqlParameter("@IDProductRestrictions", SqlDbType.Int, 4)
paramIDProductRestrictions.Value = IDProductRestrictions
myCommand.Parameters.Add(paramIDProductRestrictions)
'
Dim paramIDProduct As SqlParameter = New SqlParameter("@IDProduct", SqlDbType.Int, 4)
paramIDProduct.Value = IDProduct
myCommand.Parameters.Add(paramIDProduct)
'
Dim paramMaxiumWidth As SqlParameter = New SqlParameter("@MaxiumWidth", SqlDbType.VarChar, 3800)
paramMaxiumWidth.Value = MaxiumWidth
myCommand.Parameters.Add(paramMaxiumWidth)
'
Dim paramMaxiumLength As SqlParameter = New SqlParameter("@MaxiumLength", SqlDbType.VarChar, 3800)
paramMaxiumLength.Value = MaxiumLength
myCommand.Parameters.Add(paramMaxiumLength)
'
Dim paramMinimumWidthForLiftTilt As SqlParameter = New SqlParameter("@MinimumWidthForLiftTilt", SqlDbType.VarChar, 3800)
paramMinimumWidthForLiftTilt.Value = MinimumWidthForLiftTilt
myCommand.Parameters.Add(paramMinimumWidthForLiftTilt)
'
Dim paramInsideMount As SqlParameter = New SqlParameter("@InsideMount", SqlDbType.VarChar, 3800)
paramInsideMount.Value = InsideMount
myCommand.Parameters.Add(paramInsideMount)
'
Dim paramOutsideMount As SqlParameter = New SqlParameter("@OutsideMount", SqlDbType.VarChar, 3800)
paramOutsideMount.Value = OutsideMount
myCommand.Parameters.Add(paramOutsideMount)
'
Dim paramControlTilt As SqlParameter = New SqlParameter("@ControlTilt", SqlDbType.VarChar, 3800)
paramControlTilt.Value = ControlTilt
myCommand.Parameters.Add(paramControlTilt)
'
Dim paramStackingFormulas As SqlParameter = New SqlParameter("@StackingFormulas", SqlDbType.VarChar, 3800)
paramStackingFormulas.Value = StackingFormulas
myCommand.Parameters.Add(paramStackingFormulas)
'
Dim paramRestrictFive As SqlParameter = New SqlParameter("@RestrictFive", SqlDbType.VarChar, 3800)
paramRestrictFive.Value = RestrictFive
myCommand.Parameters.Add(paramRestrictFive)
'
Dim paramRestrictSix As SqlParameter = New SqlParameter("@RestrictSix", SqlDbType.VarChar, 3800)
paramRestrictSix.Value = RestrictSix
myCommand.Parameters.Add(paramRestrictSix)
'
Dim paramRestrictSeven As SqlParameter = New SqlParameter("@RestrictSeven", SqlDbType.VarChar, 3800)
paramRestrictSeven.Value = RestrictSeven
myCommand.Parameters.Add(paramRestrictSeven)
'
Dim paramRestrictEight As SqlParameter = New SqlParameter("@RestrictEight", SqlDbType.VarChar, 3800)
paramRestrictEight.Value = RestrictEight
myCommand.Parameters.Add(paramRestrictEight)
'
Dim paramRestrictNine As SqlParameter = New SqlParameter("@RestrictNine", SqlDbType.VarChar, 3800)
paramRestrictNine.Value = RestrictNine
myCommand.Parameters.Add(paramRestrictNine)
'
Dim paramRestrictTen As SqlParameter = New SqlParameter("@RestrictTen", SqlDbType.VarChar, 3800)
paramRestrictTen.Value = RestrictTen
myCommand.Parameters.Add(paramRestrictTen)
'
Dim paramRestrictEleven As SqlParameter = New SqlParameter("@RestrictEleven", SqlDbType.VarChar, 3800)
paramRestrictEleven.Value = RestrictEleven
myCommand.Parameters.Add(paramRestrictEleven)
'
Dim paramRestrictTwelve As SqlParameter = New SqlParameter("@RestrictTwelve", SqlDbType.VarChar, 3800)
paramRestrictTwelve.Value = RestrictTwelve
myCommand.Parameters.Add(paramRestrictTwelve)
'
myCommand.ExecuteNonQuery() 'Execute the UPDATE query
'
cnn.Close()
'
'Finally, set the EditItemIndex to -1 and rebind the DataGrid
'
dgUpdateProductRestrictions.EditItemIndex = -1
BindData()
End Sub
End Class

=====================Grid----------------

<asp:datagrid id="dgUpdateProductRestrictions" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 8px"
="" runat="server" oneditcommand="dgProducts_Edit" oncancelcommand="dgProducts_Cancel" onupdatecommand="dgProducts_Update">
<footerstyle backcolor="Tan">
<selecteditemstyle forecolor="GhostWhite" backcolor="DarkSlateBlue">
<alternatingitemstyle backcolor="PaleGoldenrod">
<itemstyle wrap="False">
<headerstyle backcolor="#99CCCC">
<columns>
<asp:editcommandcolumn buttontype="PushButton" updatetext="Update" canceltext="Cancel" edittext="Edit Info">
<asp:boundcolumn datafield="ProductRestrictionsID" headertext="ProductRestrictionsID">
<asp:boundcolumn datafield="ProductID" readonly="True" headertext="ProductID">
<asp:boundcolumn datafield="MaximumWidth" headertext="MaxiumWidth">
<asp:boundcolumn datafield="MaximumLength" headertext="MaxiumLength">
<asp:boundcolumn datafield="MinimumWidthForLiftTilt" headertext="MinimumWidthForLiftTilt">
<asp:boundcolumn datafield="InsideMount" headertext="InsideMount">
<asp:boundcolumn datafield="OutsideMount" headertext="OutsideMount">
<asp:boundcolumn datafield="ControlTilt" headertext="ControlTilt">
<asp:boundcolumn datafield="StackingFormulas" headertext="StackingFormulas">
<asp:boundcolumn datafield="RestrictFive" headertext="RestrictFive">
<asp:boundcolumn datafield="RestrictSix" headertext="RestrictSix">
<asp:boundcolumn datafield="RestrictSeven" headertext="RestrictSeven">
<asp:boundcolumn datafield="RestrictEight" headertext="RestrictEight">
<asp:boundcolumn datafield="RestrictNine" headertext="RestrictNine">
<asp:boundcolumn datafield="RestrictTen" headertext="RestrictTen">
<asp:boundcolumn datafield="RestrictEleven" headertext="RestrictEleven">
<asp:boundcolumn datafield="RestrictTwelve" headertext="RestrictTwelve">


GeneralRe: Datagrid will not update Pin
erikkl200010-Jul-05 16:07
erikkl200010-Jul-05 16:07 
QuestionHi : How to make a chatting program like yahoo and msn ? Pin
SmartSDR10-Jul-05 3:52
SmartSDR10-Jul-05 3:52 
AnswerRe: Hi : How to make a chatting program like yahoo and msn ? Pin
Ranoush10-Jul-05 3:56
Ranoush10-Jul-05 3:56 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
SmartSDR10-Jul-05 4:07
SmartSDR10-Jul-05 4:07 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
Dave Kreskowiak10-Jul-05 8:21
mveDave Kreskowiak10-Jul-05 8:21 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
SmartSDR10-Jul-05 9:07
SmartSDR10-Jul-05 9:07 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
Dave Kreskowiak10-Jul-05 14:40
mveDave Kreskowiak10-Jul-05 14:40 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
SmartSDR11-Jul-05 4:41
SmartSDR11-Jul-05 4:41 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
Dave Kreskowiak12-Jul-05 1:14
mveDave Kreskowiak12-Jul-05 1:14 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
SmartSDR12-Jul-05 2:21
SmartSDR12-Jul-05 2:21 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
Dave Kreskowiak12-Jul-05 11:54
mveDave Kreskowiak12-Jul-05 11:54 
GeneralRe: Hi : How to make a chatting program like yahoo and msn ? Pin
SmartSDR14-Jul-05 1:58
SmartSDR14-Jul-05 1:58 
GeneralExport Acces DB Table To txt File Pin
Ranoush10-Jul-05 3:46
Ranoush10-Jul-05 3:46 
GeneralRe: Export Acces DB Table To txt File Pin
Anonymous10-Jul-05 8:08
Anonymous10-Jul-05 8:08 
GeneralRe: Export Acces DB Table To txt File Pin
Ranoush10-Jul-05 20:33
Ranoush10-Jul-05 20:33 
Questionhi : string.startwith doesn't work ????? Pin
10-Jul-05 3:18
suss10-Jul-05 3:18 
AnswerRe: hi : string.startwith doesn't work ????? Pin
Ranoush10-Jul-05 3:38
Ranoush10-Jul-05 3:38 

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.