Foros del Web » Programación para mayores de 30 ;) » .NET »

Problema al cargar tablestyles

Estas en el tema de Problema al cargar tablestyles en el foro de .NET en Foros del Web. BUENAS TARDES COMPAÑEROS DEL FORO, ALGUIEN ME PODRIA DECIR QUE ESTOY HACIENDO MAL? TENGO ESTE CODIGO PARA ABRIR MI CONEXION A LA BASE DE DATOS ...
  #1 (permalink)  
Antiguo 06/08/2010, 14:35
 
Fecha de Ingreso: junio-2010
Mensajes: 12
Antigüedad: 13 años, 10 meses
Puntos: 0
Problema al cargar tablestyles

BUENAS TARDES COMPAÑEROS DEL FORO, ALGUIEN ME PODRIA DECIR QUE ESTOY HACIENDO MAL? TENGO ESTE CODIGO PARA ABRIR MI CONEXION A LA BASE DE DATOS EN SQL SERVER:

Imports System.Data.SqlClient
Public Class Form1
Inherits System.Windows.Forms.Form
Public cnn As Data.SqlClient.SqlConnection
Private DS As New DataSet
Private Adapter As New Data.SqlClient.SqlDataAdapter

Public Sub conectar()
cnn = New Data.SqlClient.SqlConnection("data source=hack;initial catalog=APREM;integrated security=SSPI;persist security info=False;workstation id=sa;packet size=4096;")
cnn.Open()
End Sub

Public Sub desconectar()
cnn.Close()
End Sub


TENGO MI TABLA DE ESTILOS ASI:

Private Sub ChangeGrid()
Dim ts1 As New DataGridTableStyle
ts1.MappingName = "detalle"
DataGrid1.CaptionText = "MINUTA DE PEDIDO"
DataGrid1.CaptionForeColor = Color.Aquamarine

Dim TextCol As New DataGridTextBoxColumn

TextCol = New DataGridTextBoxColumn
TextCol.MappingName = "cantidad_pedido"
TextCol.HeaderText = "CANT"
TextCol.Alignment = HorizontalAlignment.Left
TextCol.Width = 20
ts1.GridColumnStyles.Add(TextCol)
TextCol = Nothing

DataGrid1.TableStyles.Add(ts1)
End Sub


TENGO MI FORM1 CON UNA CONSULTA CHIQUITA ASI:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
call ChangeGrid()
Try
Dim Comando As SqlClient.SqlCommand = New SqlClient.SqlCommand
Dim objSum As Object
conectar()
Comando.CommandText = "Select cantidad_pedido from detalle where idordendet = '18'"
Comando.Connection = cnn
Adapter.SelectCommand = Comando
Adapter.Fill(DS)
DataGrid1.DataSource = DS.Tables(0)
objSum = DS.Tables(0).Compute("Sum(cantidad_pedido)", Nothing)
TOTAL.Text = (CStr(objSum))
Catch ex As Exception
MsgBox("INGRESE LA CANTIDAD DE LA MESA", MsgBoxStyle.Information)
End Try
End Sub
End Class


TENGO MI FORM CON EL DATAGRID Y UN LABEL QUE ME SACA LA SUMA DE LA COLUMNA, PERO A PESAR DE QUE LLAMO AL TABLESTYLES CHANGEGRID() AL PRINCIPIO ME SIGUE SACANDO EL EL ENCABEZADO cantidad_pedido Y NO "CANT" COMO LE PUSE Y EL NUMERO ES PEQUEÑO Y LA CELDA GRANDOTA, NO SE SI ESTOY LLAMANDO BIEN AL TABLESTYLES O QUE PERO NO ME MUESTRA EL FORMATO QUE ESPECIFIQUE SI ALGUIEN VE ALGUN ERROR EN EL CODIGO PORFA DIGANME, SE LOS AGRADECERE BASTANTE.

  #2 (permalink)  
Antiguo 09/08/2010, 11:24
 
Fecha de Ingreso: junio-2010
Mensajes: 12
Antigüedad: 13 años, 10 meses
Puntos: 0
Respuesta: Problema al cargar tablestyles

alguien????

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:00.