|
#1 -
17/03/2008 23:03:43
|
Reporta abuso
|
Link Permanente
|
|
Traducir codigo C# a VB
|
|
|
|
|
|
Hola chicos, necesito de vuestra ayuda. Tengo el siguiente codigo en en una pagina Default.aspx.cs
protected void gvCustomers_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { SqlDataSource ctrl = e.Row.FindControl("sqlDsSubGrupos") as SqlDataSource; if (ctrl != null && e.Row.DataItem != null) { ctrl.SelectParameters["CustomerID"].DefaultValue = ((DataRowView)e.Row.DataItem)["OBJECT_ID"].ToString(); } } }
Necesito convertir este codigo a VB.Net y despues de muchas pruebas no consigo realizarlo. Me podriais ayudar? Gracias de antemano
Adiemus
|
|
|
|
|
|
|
|
|
#3 -
24/04/2008 12:37:20
|
Reporta abuso
|
Link Permanente
|
|
RE: Traducir codigo C# a VB
|
|
|
Hola,
¿Y qué parte te falla?
Creo que con algo así debería funcionarte
Protected Sub gvCustomers_RowCreated(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles gvCustomer.RowCreated If (e.Row.RowType = DataControlRowType.DataRow) Then Dim ctrl As SqlDataSource = e.Row.FindControl("sqlDsSubGrupos") If ((Not ctrl Is Nothing And (Not e.Row.DataItem Is Nothing)) Then ctrl.SelectParameters["CustomerID"].DefaultValue = CType(e.Row.DataItem, DataRowView)("OBJECT_ID").ToString() End If End If End Sub
Saludos.
|
|
|
|
|
|
|
|