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

problema en concatenacion

Estas en el tema de problema en concatenacion en el foro de .NET en Foros del Web. <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,culture=neutral" %> <%# dim dia as string dim mes as string dim year as ...
  #1 (permalink)  
Antiguo 15/04/2008, 11:38
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 1 mes
Puntos: 1
problema en concatenacion

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,culture=neutral" %>
<%# dim dia as string
dim mes as string
dim year as string
dia = request.form("DropDownList1")
mes = request.form("DropDownList2")
year = request.form("DropDownList3")

fecha = dia & "/" & mes & "/" & year
%>

<MM:Insert
runat="server"
CommandText='<%# "execute dbo.insertarfecha @fecha" %>'
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_cn1") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETYPE_cn1") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
Debug="true"
>
<Parameters>
<Parameter Name="@fecha" Value='<%# IIf((Request.Form("fecha") <> Nothing), Request.Form("fecha"), "") %>' Type="VarChar" />
</Parameters>
</MM:Insert>
<MM:DataSet
id="DataSet1"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_cn1") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETYPE_cn1") %>'
CommandText='<%# "SELECT * FROM dbo.año" %>'
Debug="true"
></MM:DataSet>
<MM:DataSet
id="DataSet2"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_cn1") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETYPE_cn1") %>'
CommandText='<%# "SELECT * FROM dbo.mes" %>'
Debug="true"
></MM:DataSet>
<MM:DataSet
id="DataSet3"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_STRING_cn1") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSett ings("MM_CONNECTION_DATABASETYPE_cn1") %>'
CommandText='<%# "SELECT * FROM dbo.dia" %>'
Debug="true"
></MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>


<body>
hoy ese el dia

<form method='POST' name='form1' id="form1" runat='server'>
<table width="200" border="1">
<tr>
<td><asp:DropDownList ID="DropDownList1" DataSource="<%# DataSet1.DefaultView %>" DataTextField="a&ntilde;o" DataValueField="a&ntilde;o" runat="server"></asp:DropDownList></td>
<td><asp:DropDownList ID="DropDownList2" DataSource="<%# DataSet2.DefaultView %>" DataTextField="mes" DataValueField="mes" runat="server"></asp:DropDownList></td>
<td><asp:DropDownList ID="DropDownList3" DataSource="<%# DataSet3.DefaultView %>" DataTextField="dia" DataValueField="dia" runat="server"></asp:DropDownList></td>
</tr>
</table>
<p>
<label>
<input type="submit" name="Submit" value="Enviar" />
</label>
</p>
<input type="hidden" name="MM_insert" value="form1">
</form>
</body>
</html>


este es el codigo q meti....para concatenar 3 combos..... pero me sale el sgte error....kisiera saber en q hago la falla


Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30201: Expression expected.

Source Error:



Line 1: <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
Line 2: <%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicK eyToken=836f606ede05d46a,culture=neutral" %>
Line 3: <%# dim dia as string
Line 4: dim mes as string
Line 5: dim year as string


Source File: c:\inetpub\wwwroot\paginaesglo\pruebacombo.aspx Line: 3



espero q me puedan ayudar.....
  #2 (permalink)  
Antiguo 15/04/2008, 11:52
Avatar de Peterpay
Colaborador
 
Fecha de Ingreso: septiembre-2007
Ubicación: San Francisco, United States
Mensajes: 3.858
Antigüedad: 16 años, 8 meses
Puntos: 87
Re: problema en concatenacion

si vas a hacer tu code en la misma pagina aspx create una funcion sino pasalo al codebehind en alguno de los eventos q te convenga mas (page_load) yo diria
__________________
Curso WF4
http://cursos.gurudotnet.com/ DF
Aprende HTML5
  #3 (permalink)  
Antiguo 15/04/2008, 12:47
 
Fecha de Ingreso: marzo-2008
Mensajes: 286
Antigüedad: 16 años, 1 mes
Puntos: 1
Re: problema en concatenacion

es q yo estoy usando el dreamweaver....alguna sugernecia...para concatenar los 3 combos q tengo
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 05:43.