culebrin 0 Junior Poster in Training

I hope someone can help me:

I have valued pairs, attributes names and values in one hand, and I have an object with attributes. I need to set the values of those attributes. I need something like

For each pairName in ListPairs
  Object.GetAttByName(pairName(name)) = pairName(value)
Next

I wonder if thats possible... or something like it.

Thanks

culebrin 0 Junior Poster in Training

Uhmmmm well I don't see anything strange, maybe you can try with only one pair of parameters at a time

culebrin 0 Junior Poster in Training

Thank you very much for your answer adapost, but I have no luck with your solution, maybe if I clariffy some things about my report...

I'm assuming that the subreport is in the details section, and the other fields are in a separated details section.

I have an image in a separated details section as a background (underlay following section setted) because I'm printing on a preprinted paper.

Then i have multiple details sections and one of them is the subreport.

That's how I put it:

report:
----------detail 1-------- <---------- underlay following sections
| BACKGROUND |
|----------detail 2--------|
|some fields (headers)|
|----------detail 3--------| <-------------- NewPageBefore
| subreport |
| (this is my problem) |
|----------detail 4--------|
| another fields and a |
|subrpt(not problem) |
----------------------------

subreport:
--------page header --- <-------------- NewPageBefore
| (suppressed) |
----------detail----------
| |
---------------------------

What is wrong there? and thankyou again.

culebrin 0 Junior Poster in Training

Hi,

I've been working on a report and it has 2 subreports, one of them can outgrow the region destinated for it (on a preprinted paper), and I want to break the subreport on a new page of the main report (with page header and page footer).

How can I accomplish this? If anybody can give me a hint, or even better can make a rpt sample of my case would be appreciated.

Thanks!

culebrin 0 Junior Poster in Training

Hi,

I've been googling about a simple source code for crystal reports for about 2 weeks now, and no luck.

So I wonder if anyone have a source code for a simple report (maybe with subreports and external parameters) on ASP.NET (I'm using VS2008 and the CR emmbeded in it -don't know the version-)

Thanks!

culebrin 0 Junior Poster in Training

Hi,

There's not much to add to the title... after I assign the complex object to the session object, the following response.redirect method stops working and hangs the development server. (I tried without it and it works great)

maybe there is some considerations to care about session objects, I don't know...

Help please!...

Thanks

culebrin 0 Junior Poster in Training

Hi,

I have this:

Public Class bParentClass
[...]
End Class

Public Class bChildClass1
inherits bParentClass
[...]
End Class

So, I do this:

Dim vChildClass1 as bChildClass1 '<-- Here I create a reference to a child class type

vChildClass1 = New bChildClass1 '<-- Here I point to a new object of the class type

Dim vParentClass1 as bParentClass '<-- Here I create a reference to a parent class type

vParentClass1 = vChildClass1 '<-- Here I point the parent type reference to a child type reference

At this point, I understand that, the original child object in memory, NOT THE REFERENCE, created remain the same, therefore, if I do

TypeOf vParentClass1 Is bChildClass1

(the reference is still pointing to the same object) it should be true, but is not, someone can explain me why?, and most importantly, how can I get the original type (the one that object was created) from the parent reference? someting like the viewstate object, it keep the type intact.

Or maybe I just totally wrong... :S

Thanks

culebrin 0 Junior Poster in Training

Thank you Ramesh, that's sort of what I needed...

culebrin 0 Junior Poster in Training

Hi,

I'm developing an AJAX website, and I want to make it compatible with most browsers and its many versions in the market.

I've been using IE, FF and Chrome, for many years, and I know his popular versions (not everyone updates, you know), but I never used Opera, and I want to make my site opera-friendly, so, I wan't to know (besides the latest version) wich version of Opera browser is popular in the browser market?

Thanks!

Omar

culebrin 0 Junior Poster in Training

Hi,

Is there any chance to get a visual basic 6 compiler for free? I mean, I have a vb6 project (made with the visual studio 6 IDE), but I have no IDE (visual studio 6 or something).

Thank you very much.

Omar

culebrin 0 Junior Poster in Training

Hi, I've tried to get the geolocation of the clients IP, with this code:

Dim rssReq As System.Net.WebRequest = _
System.Net.WebRequest.Create("http://freegeoip.appspot.com/xml/" _
& vl_bContadorVisitasBE.vcConVisIP)

'Crear el Proxy
Dim px As New System.Net.WebProxy("http://freegeoip.appspot.com/xml/" _
& vl_bContadorVisitasBE.vcConVisIP, True)

'Asignar el Proxy al objeto WebRequest
rssReq.Proxy = px

'Establecer el tiempo de vida al objeto WebRequest
rssReq.Timeout = 2000

Try
'Obtener el objeto WebResponse
Dim rep As System.Net.WebResponse = rssReq.GetResponse()              <-- ERROR

'Insertar el objeto Response en el objeto XMLTextReader
Dim xtr As New System.Xml.XmlTextReader(rep.GetResponseStream())

'Insertar el objeto Response en el objeto DataSet
ds.ReadXml(xtr)

Catch ex As Exception

End Try

But I keep getting the error "The underlying connection was closed: An unexpected error occurred on a receive." when executes the GetResponse line.

I tried to get better methods to do the same, but no luck.

The XML returned by the WS (http://freegeoip.appspot.com/xml/200.62.145.200) is something like this:

<?xml version="1.0" encoding="UTF-8" ?> 
<Response>
  <Status>true</Status> 
  <Ip>200.62.145.200</Ip> 
  <CountryCode>PE</CountryCode> 
  <CountryName>Peru</CountryName> 
  <RegionCode>15</RegionCode> 
  <RegionName>Lima</RegionName> 
  <City>Lima</City> 
  <ZipCode /> 
  <Latitude>-12.05</Latitude> 
  <Longitude>-77.05</Longitude> 
  </Response>

So I need to parse into a ds or a dt, or something that I could read.

Thanks in advance.

Omar

culebrin 0 Junior Poster in Training

Hi,

I have a table maintenance page, and it has several details rows (and its respective maintenance page for that detail). Then I want to edit the detail using the modalpopupextender. I don't want to duplicate codes using the same that I have already. So I'm wondering, if its possible to show the content of a existent webpage inside the modalpopupextender.

If you need some code, let me know. Thank you very much.

Omar

culebrin 0 Junior Poster in Training

Hi,

I have 2 projects, the business entity, there I have all the classes mapped from the database and the web project where I fill those business entity classes. Then, I need to store in a DB. I have the globalization set in the web.config on the web project. (VS2008, NET 3.5, SQL 2005)

My problem is when I have an instance of the BE class, and I have a date attribute on it, the value entered is not formatted according the globalization in the web.config, and obviously when I pass to the class to store in the DB it fails due to date format.

I think is missing some configuration... but I googled for it and no luck.

There you have part of my coding:

Business Entity:

Public Class Categoria
    Inherits AuditBaseClass

    Private _categ_id As String
    Private _categ_descripcion As String
    Private _categ_tipo_item As Integer
    Private _categ_parent As String
    Private _categ_estado_registro As Char
    Private _creado_usuario As String
    Private _creado_fecha As DateTime
    Private _modificado_usuario As String
    Private _modificado_fecha As DateTime

[...]

    Public Property creado_fecha() As DateTime
        Get
            Return Me._ creado_fecha
        End Get
        Set(ByVal value As DateTime)
            Me._ creado_fecha = value
        End Set
    End Property

[...]

End Class

Web Project (WebSite)

Private Sub guardar_datos()

        Dim oCategoriaWCF As New definiciones.DefinicionesClient    '<--- Class to store in DB
        Dim oCategoriaBE As New BE.Categoria                         '<--- Object with the Date Attribute

        Dim result As Integer = -1

        oCategoriaBE.id = CInt(Session.Item("data.id"))
        oCategoriaBE.categ_descripcion = Me.txtDescripcion.Text.Trim
        oCategoriaBE.categ_tipo_item = Me.ddlTipoItem.SelectedValue
        oCategoriaBE.categ_parent = Me.ddlParent.SelectedValue.Trim
        If oCategoriaBE.id = …
culebrin 0 Junior Poster in Training

Well, Someone might wanna know this...

I solved the problem putting the close method at the end of the call.

'some code ...

            Dim oAlmacenWCF As New repositorio.RepositorioClient
            Dim oListaAlmacenBE As List(Of BE.Almacen)
            oListaItemAlmacenBE = oAlmacenWCF.ListarAlmacen(item_id)
            oAlmacenWCF.Close()

'some code

I hope this helps someone...

culebrin 0 Junior Poster in Training

Another thing. The method time span is long enough (the default timeout value is 60 secs) to execute it (it's just a query of one table), and I have no idea why, when executes the first time, it works, and the second time it didn't.

culebrin 0 Junior Poster in Training

Hi Ramesh,

Thank you very much for the answer, I've been looking how to do it in the web.config (i have a website client, and I want to do it in the web.config), but have no luck...

This is my first try ... and I'm not quit sure if I have the concepts right.

My proxy is generated with the vs2008 with the option "Add Service Reference..."

My client web.config has:

<system.serviceModel>
    <bindings>
 <wsHttpBinding>
           <binding name="WSHttpBinding_IRepositorio" closeTimeout="00:01:00"
             openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
             bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
             maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
             textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
             <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
             <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
             <security mode="Message">
                <transport clientCredentialType="Windows" proxyCredentialType="None"
                   realm="" />
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                   algorithmSuite="Default" establishSecurityContext="true" />
             </security>
          </binding>
       </wsHttpBinding>
    </bindings>
      <client>
<endpoint address="http://localhost:7604/Repositorio.svc" binding="wsHttpBinding"
    bindingConfiguration="WSHttpBinding_IRepositorio" contract="repositorio.IRepositorio"
    name="WSHttpBinding_IRepositorio">
    <identity>
     <dns value="localhost" />
    </identity>
   </endpoint>
      </client>
	</system.serviceModel>

And I'm not sure where to put the OperationTimeout property.

Thanks.

Omar

Set the timeout properties of WCF application to increase the default timeout. This can be done on the client side programmically or with a client side App.Config or a Web.config.

You can configure the OperationTimeout property for Proxy in the WCF client code.

For example

DirectCast(service, IContextChannel).OperationTimeout = New TimeSpan(0, 0, 240)

Refer: http://www.codeproject.com/KB/WCF/WCF_Operation_Timeout_.aspx

culebrin 0 Junior Poster in Training

Hi,

I a real newbie on WCF, and I want to implement a service that reads from a DB some data and returns generic lists of custom objects to the client.

So I implement the service like this:
Interface:

<ServiceContract()> _
Public Interface IRepositorio

    <OperationContract(Name:="ListarAlmacen")> _
    Function ListarAlmacen() As List(Of BE.Almacen)

End Interface

Implementation:

<AspNetCompatibilityRequirementsAttribute(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
<ServiceBehavior(UseSynchronizationContext:=True, InstanceContextMode:=InstanceContextMode.PerSession, ConcurrencyMode:=ConcurrencyMode.Multiple)> _
Public Class Repositorio
    Implements IRepositorio

    Public Function ListarAlmacen() As List(Of BE.Almacen) Implements IRepositorio.ListarAlmacen
        Dim result As List(Of BE.Almacen)
        result = BL.Repositorio.Almacen.listar()
        Return result
    End Function

End Class

and on the client (a ASP.NET website, added the ServiceReference on the project),

'some code ...

            Dim oAlmacenWCF As New repositorio.RepositorioClient
            Dim oListaAlmacenBE As List(Of BE.Almacen)
            oListaItemAlmacenBE = oAlmacenWCF.ListarAlmacen(item_id)

'some code

So, my problem is that when I first call the ListarAlmacen method it works ok, but when I tried to call it a second time, it gave me a timeout exception, I tried to step into to debug it, the first time it works, the debug steps into it; but the second time, it didn't.

I just have no idea what's happening, I tried some tips, but no luck (service log, web.config hacks, etc.).

Please some can tell me where's is the problem or how can I know for sure where to look for the problem...

Thanks!

culebrin 0 Junior Poster in Training

I used the "Control.ClientID" to reference my control, but no luck...

and I can't use a client side control, because I need to access it in the server also...

I gave up, I know there's a solution out there, but I have no time... I'm on a schedule... Thanks a lot!! to all of you... !!

It can be done,

Please use this form,

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
<script type="text/javascript">
function setval() {
    themsg = document.getElementById("<%=txtMessage.ClientID%>");
    themsg.value="Hello World!";
}
</script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:TextBox ID="txtMessage" runat="server" Text=""></asp:TextBox>
        <asp:Button ID="btnSeeMessage" runat="server" Text="see" onclick="SeeMessage" />
    </form>
    <input id="cID" onclick="setval();" type="button" value="Set from client" />
</body>
</html>

From server side,

protected void SeeMessage(object sender, EventArgs e)
    {
        Response.Write(txtMessage.Text);
    }

Please use <%=ServerControlName.ClientID%> everytime you wanna access a server control from client side.

culebrin 0 Junior Poster in Training

Hi,

I have a website on NET 2.0, there I have a textbox and after I change the text on it with a js function, try to save on the DB (I have to click on a imagebutton to save it), but on the postback the textbox.text property has the previous value.

I need some guidance on how to resolve this.

Here's my code:

JS inserted with a RegisterClientScriptBlock method: <-- This works fine

<script type="text/JavaScript"> 
function Calcular() {
if (!(isNaN(parseFloat(document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagSaldoPrevioPago').value)) && isNaN(parseFloat(document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagPagoActual').value)))) {
document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcSaldoPostPago').value = parseFloat(document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagSaldoPrevioPago').value) - parseFloat(document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagPagoActual').value);
} else {
document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcSaldoPostPago').value = '0.0';}
}
function ActualizaMonto() {
if (!(isNaN(parseFloat(document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagSaldoPrevioPago').value)) && isNaN(parseFloat(document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagPagoActual').value)))) {
document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagSaldoPrevioPago').value = parseFloat(document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagMontoTotal').value);
} else {
document.getElementById('ctl00_cphVentanillaAtencionMaster_txtdcPagMontoTotal').value = '0.0';}
}
</script>

on PostBack I try to do this:

oPagosBE.btPagActivo = True

oPagosBE.dcPagMontoTotal = Me.txtdcPagMontoTotal.Text
oPagosBE.dcPagPagoActual = Me.txtdcPagPagoActual.Text
oPagosBE.dcPagSaldoPrevioPago = Me.txtdcPagSaldoPrevioPago.Text   <--- THIS VALUE POSTBACKS WITH THE INITIAL VALUE (BEFORE JS)
oPagosBE.dtPagFechaRegistro = IIf(IsDate(Me.txtdtPagFechaRegistro.Text.Trim), Me.txtdtPagFechaRegistro.Text.Trim, #1/1/1900#)
oPagosBE.vcPagUsuarioRegistrante = Session.Item("vcUsuCodigo")
          
bExito = bPagosBL.Insertar(oPagosBE)

Thanks

culebrin 0 Junior Poster in Training

Hi,

Using ajax, I manage to solve this, registering the imagebutton for postback in the scriptmanager... and that's it!

culebrin 0 Junior Poster in Training

Hi again,

I found my own answer... I used CustomValidator and set the OnServerValidate property to a method on the codebehind to go through the gridview comparing the SelectedValue of the current dropdownlist...

I hope that helps to someone... If anyone want some code, send me a private message...

Thanks again!

culebrin 0 Junior Poster in Training

Hi,

I have a DropDownList (filled in the rowCreated method) in a TemplateColumn in a GridViewRow.
A user can add a row to select another value in the new dropdownlist created.

I need to trigger a validator (I need this because this is only a small part of a site that shows validations using the validatorcalloutextender and I am trying to avoid to simulate the funcionality of the validator) that validates if someone tries to select the same value of the dropdownlist...

I just wonder if that can be possible, or, I just have to settle with the simulation...

Thanks!

culebrin 0 Junior Poster in Training

I tried it, and it reaches the event, as you said, but the problem now is that the HasFile property of the FileUpload control is false when after I select the file... And I don't know why...

I hope you can help me with this...

Private Sub imgEnvio_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
        Dim fup As FileUpload
        Dim img As ImageButton
        fup = CType(sender.Parent.Parent, GridViewRow).FindControl("fupvcProDiaRutaPropuesta")
        img = CType(sender.Parent.Parent, GridViewRow).FindControl("imgProDiagUploadPropuesta")
        If fup.HasFile Then <-- this is not true after I select the file
            img.Attributes.Remove("Style")
            Dim fullpath = IO.Path.GetFullPath(fup.FileName)
            Dim name = IO.Path.GetFileName(fullpath)
            fup.SaveAs(Server.MapPath("~") + "\Documentos\" & name.ToString)
        End If
    End Sub

Write the following code in RowDataBound event of the GridView control. This code is to attach onChange event of the file upload control to the click event of image button control.

imgRespuesta = e.Row.FindControl("imgProDiagUploadRespuesta")fupRespuesta = e.Row.FindControl("fupvcProDiaRutaRespuesta")

fupRespuesta.Attributes.Add("onchange", "return document.getElementById('" + imgRespuesta.ClientID + "').click();")

Write this code in RowCreated event of the GridView. This code is to set style for image button and add handler to it.

imgRespuesta = e.Row.FindControl("imgProDiagUploadRespuesta")
imgRespuesta.Attributes.Add("Style", "Display:none")
AddHandler imgRespuesta.Click, AddressOf img_Click

I have tested this way in C#. It is working for me. I can able to reach img_Click event if a file is browsed and selected.

culebrin 0 Junior Poster in Training

Hi,

I have a gridview that has a fileupload (fupRespuesta) control in a itemtemplate field, I need to enable automatic upload after file is selected.

Then I added a imageButton (imgRespuesta) in the template field and added its event with addhandler...

Well my problem is that when I uncomment the red line, the event of the image button don't fire (I can't understand why)

I need it work, or some other idea to do it.

Heres my code:

Private Sub gv_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvPropuestasDiagnosticoListar.RowCreated

Dim imgRespuesta As New ImageButton
        Dim fupRespuesta As New FileUpload
        imgRespuesta = e.Row.FindControl("imgProDiagUploadRespuesta")
        fupRespuesta = e.Row.FindControl("fupvcProDiaRutaRespuesta")
        If Not imgRespuesta Is Nothing And Not fupRespuesta Is Nothing Then
            AddHandler imgRespuesta.Click, AddressOf img_Click
            'imgRespuesta.Attributes.Add("Style", "Display:none")
            'fupRespuesta.Attributes.Add("onchange", "return document.getElementById('" + imgRespuesta.ClientID + "').click();")
        End If
End Sub

Private Sub img_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
        Dim fup As FileUpload
        Dim img As ImageButton
        fup = CType(sender.Parent.Parent, GridViewRow).FindControl("fupvcProDiaRutaPropuesta")
        img = CType(sender.Parent.Parent, GridViewRow).FindControl("imgProDiagUploadPropuesta")
        If fup.HasFile = True Then
            img.Attributes.Remove("Style")
            Dim fullpath = IO.Path.GetFullPath(fup.FileName)
            Dim name = IO.Path.GetFileName(fullpath)
            fup.SaveAs(Server.MapPath("~") + "\Documentos\" & name.ToString)
        End If
    End Sub
culebrin 0 Junior Poster in Training

Thanks... but I tried it, and It didn't worked. I just have to give up that idea, coz I'm on a schedule...

Thank you very much...

culebrin 0 Junior Poster in Training

Hi,

I have a dataset build at design time (vs 2008) with several tables of my DB (MSSQL 2005).

I have a DataTable with its tableadapter... I need that the TableAdapter.Update function returns the key updated (always will be a single row updated at the time).

I know, I passed the primarykey to filter the update statement, so it means that I already have the value, but I really need the update function return the key value ...

I tried replacing the update commandtext value replacing the last select statement with "select @keyparameter" statement and executing it as Scalar... but no luck...

Please someone can help me with this... It would very apreciated...

Thanks

Dim dt As New DA.Repositorio.ItemMostradorDataTable
            ItemMostradorTA.FillByKey(dt, Me.id, Nothing)

            With dt.Rows(0)
                '.Item("itemm_id") = Me.id
                .Item("itemm_descripcion") = Me.descripcion
                .Item("unime_id") = Me.unime_id
                .Item("categ_id") = Me.categ_id
                .Item("itemm_codigo_barras") = Me.itemm_codigo_barras
                .Item("itemm_minimo_alerta") = Me.minimo_alerta
                .Item("itemm_costo") = Me.itemm_costo
                .Item("itemm_precio_venta") = Me.itemm_precio_venta
                .Item("mostr_id") = Me.repositorio_id
                .Item("itemm_estado_registro") = Me.estado_registro
                .Item("creado_usuario") = Me.creado_usuario
                .Item("creado_fecha") = IIf(Me.creado_fecha.Ticks = 0, System.DBNull.Value, Me.creado_fecha)
                .Item("modificado_usuario") = Me.modificado_usuario
                .Item("modificado_fecha") = IIf(Me.modificado_fecha.Ticks = 0, System.DBNull.Value, Me.modificado_fecha)
            End With

            response = ItemMostradorTA.Update(dt)
culebrin 0 Junior Poster in Training

Next time try to explain your self properly from the begining...;

I will post it in C# code but its not a problem to convert it to VB.

Lets say that you have a HtmlTable ready with everything inside (all the rows and cells that you want, in my code its name is "tbl2".
And the cell that we want to add the table to call "tbl1Cell"
So here is the code:

HtmlTable tbl2 = new HtmlTable();

        HtmlTableCell tbl1Cell = new HtmlTableCell();

        tbl1Cell.Controls.Add(tbl2);

Now convert it to VB

Thanks, and I'll try to be more accurate on my explaining.

So, as far I can see, the trick is to construct the object before I add it, I don't know how could I miss it...

Thanks again!...

culebrin 0 Junior Poster in Training

What? from the server side?

Yes... server side... I've been doing in a simpler maner with

For Each obj As bNoticiasBE In oListaNoticiasBE

            tdvcNotTitular = New System.Web.UI.HtmlControls.HtmlTableCell
            trvcNotTitular = New System.Web.UI.HtmlControls.HtmlTableRow
            tddtNotFecha = New System.Web.UI.HtmlControls.HtmlTableCell
            trdtNotFecha = New System.Web.UI.HtmlControls.HtmlTableRow
            tdvcNotSumilla = New System.Web.UI.HtmlControls.HtmlTableCell
            trvcNotSumilla = New System.Web.UI.HtmlControls.HtmlTableRow

            'avcNotTitular()
            tdvcNotTitular.InnerHtml = "<div align=""justify"" class=""pequeno1""><a href=""wfNoticiasDetalle.aspx?tipo=" + ViewState.Item("pagina.tipo").ToString + "&id=" + obj.inNotCodigo.ToString + """><strong>" + obj.vcNotTitular.ToString + "</strong></a></div>"
            'tdvcNotTitular.InnerText = obj.vcNotTitular
            trvcNotTitular.Cells.Add(tdvcNotTitular)
            tblListaNoticias.Rows.Add(trvcNotTitular)

            tddtNotFecha.InnerHtml = "<strong><font color=""#666666"">" + obj.dtNotFechaNoticia.ToShortDateString + "</font></strong>"
            'tddtNotFecha.InnerText = obj.dtNotFechaNoticia.ToShortDateString
            trdtNotFecha.Cells.Add(tddtNotFecha)
            tblListaNoticias.Rows.Add(trdtNotFecha)

            tdvcNotSumilla.InnerHtml = "<div align=""justify"">" + obj.vcNotSumilla.ToString + "</div>"
            'tdvcNotSumilla.InnerText = obj.vcNotSumilla
            trvcNotSumilla.Cells.Add(tdvcNotSumilla)
            tblListaNoticias.Rows.Add(trvcNotSumilla)

        Next

But I don't know how insert a table, If it can be done...

culebrin 0 Junior Poster in Training

Hi,

I have a Button inside of a GridView, inside of another GridView.

The higher gv is filled with a dataset, and in the RowCreated event I fill the second gv, and finally, in the RowCreated event (handler added in the RowCreated event of the first gv) of the second gv, attach the handler of the Click event with the button inside.

I have another controls in the same way with their own events added and works fine, but this Button dont... When I press the button, it postback but the event is like not been called (even when I debugged and the rowcreated reach the line with the addhandler for the button)

Maybe some one can guide me through this...

aspx

<asp:Content ID="cVentanillaAtencionFlujo" ContentPlaceHolderID="cphVentanillaAtencionMaster" Runat="Server">
    <asp:ScriptManager ID="smVentanillaAtencionFlujo" runat="server">
    </asp:ScriptManager>

        <asp:GridView BackColor="LightGray" ShowHeader="False" ID="gvFasesListar" runat="server" AutoGenerateColumns="False"
            Width="728px" DataKeyNames="inFasCodigo">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
<table cellpadding="0" cellspacing="0" style="width: 672px; background-color:#FFFFFF">
                                                    <tr>
<td align="right">
                                                            <asp:Button ID="btnActualizarResultadosTest" CausesValidation="false" runat="server" Text="Actualizar" Width="120px" />
                                                        </td>
                                                    </tr>
                                                </table>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
                        
</asp:Content>

Code behind

If e.Row.RowType = DataControlRowType.DataRow Then
                        Dim btnActualizarResultadosTest As New WebControls.Button
                        btnActualizarResultadosTest = e.Row.FindControl("btnActualizarResultadosTest")
                        If Not btnActualizarResultadosTest Is Nothing Then
                            'AddHandler btnActualizarResultadosTest.Click, AddressOf btnActualizarResultadosTest_Click
                            AddHandler btnActualizarResultadosTest.Command, AddressOf btnActualizarResultadosTest_Command
                        End If
                    End If
culebrin 0 Junior Poster in Training

Well... i forgot to say I want to do it, in the codebehind... not in the aspx file...

culebrin 0 Junior Poster in Training

Hello folks,

I need to create a html table dynamically, so I used HtmlTable and HtmlTableCell ... but I need to put inside a HtmlTableCell another HtmlTable object, so the structure will be:

HtmlTable
|
---HtmlTableRow
|
---HtmlTableCell
|
---HtmlTable

I hope someone could help me

Thanks

Omar

culebrin 0 Junior Poster in Training

I've designed a class diagram for my business entity library, in visual studio 2005, now I was wondering if theres any way to export it to a SQL Script to generate the corresponding tables ... I hope that it can be done...

Omar

culebrin 0 Junior Poster in Training

Hi,

I need to implement a class that allow me insert as many childs as needed, like when you have a DataTable Class and add as many DataRows as needed with DataTable.Rows.Add(DataRow).

I can't figure the right way to implement it.

Please help me here...

Omar

culebrin 0 Junior Poster in Training

You only need to install workstation components as part of the installation. I don't know what you are meaning the other ones will have problems later, each part of the installation can be completed later by only selecting it with no problems, if thats what you are meaning.

Well,

I'm sorry ... I meant that, the other apps on the suite will cause some damage if I proceed with the installation...

Well... till I try we'll never know...

culebrin 0 Junior Poster in Training

just to get an idea can you show your connection strings to both instances?

Well finally I have to reinstall both instances, I don't know what happened but that solve my problem...

culebrin 0 Junior Poster in Training

This should help
http://us3.php.net/manual/en/function.mssql-connect.php#84307

Yes, that is what I needed... Thanks!

culebrin 0 Junior Poster in Training

Hope this code can help you.

1. Execute your first SP in query analyzer to show the columns list.

2. Create temporary table and the field must the same as first SP columns

create table #tmpTemp (
  Field1 varchar(255),
  Field2 varchar(255))

3. Insert the columns from first SP into temp table.

insert #tmpTemp exec sp_SP1

4. Store the column value.

declare @Field1 varchar(255)
select @Field1 = Field1 from #tmpTemp

That do the trick! thanks man!

culebrin 0 Junior Poster in Training

Well,

I did that, the problem was that I have a development machine that runs on XP SP2, and my production server runs on 2K3, works ok on windows server 2K3, but on my XP have that problem... I decided I can live with that...

Thanks to all for your help!!

Culebrin

You didn't mark it as solved, are you still stuck?

Did you find this site?

http://www.freevbcode.com/ShowCode.Asp?ID=2298

culebrin 0 Junior Poster in Training

I have to write log entries through my app (ASP.NET -VB-)

In my understanding that's what I do: created a DLL Message library, then I've created certain registry entries, and insert the log entry using System.Diagnostics.EventLog.WriteEntry method on my app, then, it insert the entry but seems to be wrong somehow, the event shows:

"The description for Event ID ( 0 ) in Source ( -sourcecreated- ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: <<HERE THE MESSAGE I WANT TO LOG>>"

So, what I need is, a Step by Step procedure to do this (baby steps if possible) to accomplish this successfuly.

Thank you

Omar

culebrin 0 Junior Poster in Training

Hi,

I don't know why the server I recently get to manage, has the SQL Server 2005 installed but with the Management Studio Express!... I need to upgrade it with the Dev version, but when I put the DVD of the SQL Server installer, It won't show my actual installation (like Office products does) instead it shows like a new one, my question is: If I only select the Management Tools option of the installation, the other ones will have problems later?

Please, I need some one who had a similar experience... or anyone!

Thanks!

culebrin 0 Junior Poster in Training

Hi,

I have 2 instances of SQL Server running on one machine (One 2K -default- and one 2K5), I have no problem connecting from a PC on LAN to the 2K5 instance, but when I try to connect to the 2K instance, it fails (it gives me an error: "Named Pipes Provider, error 40 - could not open a connection to the SQL Server"). I allow the remote connections on the properties page of the 2K.

So I ran out of choices, plz help me.

Thanks

culebrin 0 Junior Poster in Training

I have a SP (sp_test_procedure) created from a SQL Server Project in my SQL Server 2005 database, inside this SP I have a call to another SP which inside calls to a SP in another Database Server (SQL 2000) through a cross-linked connection.

When I execute it from the Management Studio it works just fine. But when I call from my PHP app It gives me an error: A .NET Framework error occurred during execution of user defined routine or aggregate 'sp_test_procedure': System.Data.SqlClient.SqlException: Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query. System.Data.SqlClient.SqlException: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.DispatchMessages(Boolean ignoreNonFatalMessages) at Microsoft.SqlServer.Server.SmiEventSink_Default.DispatchMessages(Boolean ignoreNonFatalMessages) at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.InternalEx in /home/xxxxxxxxxxx/xxx/xxxxxxx.php on line XX Obviously, I put the SET ANSI_NULLS and ANSI_WARNINGS flags inside and outside (and both at the same time xD, just in case) the creation of the all SPs mentioned...

I've tested it with all the parameters (integers, decimals and strings) in there original types and string only type, I had no luck.

So, I need to know how to resolve this, I need that SP to work on my PHP app. So any thoughts are welcome.

Thanks..

Omar

culebrin 0 Junior Poster in Training

Anyone?, Plzzzz, this is driving me crazy!!

!!

culebrin 0 Junior Poster in Training

Hi All,
I m working on a project that has different sub-projects. I would like to include a link to a file that is placed in another folder. For ex. My file whose path is ProjB/FolderB/FileB.asp --I want to write a line of code that will enable me to link to a file whose path is ProjA/FolderA/FileA.asp.
Can I achieve this using the navigateURL command?How?
Thanks in advance.

Hi,

I guess you have two options, make an Absolute Path or a Relative Path

In the absolute path, you have to put the entire URL on the link, like, http://domainname/ProjB/FolderB/FileB.asp

In the relative path, you have make a "navigation" through the folders before you can reach the file, like, if you are in ProjB/FolderB/FileB.asp and you have to reach ProjA/FolderA/FileA.asp (assuming that both are in the same server) you have to do a "../../ProjA/FolderA/FileA.asp"

Try this and post back... good luck!

culebrin 0 Junior Poster in Training

Hi all,

I need a more elegant way to do the convertion between different cultures

First I parse the field into the default culture (en-US) like this,

Dim Format As New System.Globalization.CultureInfo("en-US", True)
Dim sFecha As Date = System.DateTime.Parse(me.TextBox1.Text.Trim, Format, Globalization.DateTimeStyles.None)

What I need is a way to show in another textbox in another culture, obviously I have the option to do a: TextBox2.Text = Format(me.TextBox1.Text.Trim, "dd/MM/yyyy") but I need to be configurable to any culture selected by the user.

I hope you can help me...

Thanks

culebrin 0 Junior Poster in Training

Hi all,

I have a Stored Procedure without an output parameter but it returns one row always, this SP is called by another SP, so I need to store some of those columns in a variables of the first SP. How can I do that?

Please help.

P.D.: I have no access to the code of the first SP, and is a CLR, HEEELPPP!!!

culebrin 0 Junior Poster in Training

I think you should give a try the yello's suggestion, and to call certain column use: adobau("columnname"), columnname could be any of the columns used in the query, not exclusively of a certain table, the recordset does not know anything about the tables used in your query, it only can see the columns used in the query, all of them:

p.e:
adobau.RecordSource = "SELECT Liegenschaften.name,Liegenschaften.address,tblbau.date FROM Liegenschaften INNER JOIN tblbau ON Liegenschaften.Rimo_Liegnr = tblbau.Liegenschaft"

and the call:

textbox1.text = adobau("name")
textbox2.text = adobau("address")
textbox3.text = adobau("date")

and so on no matter which table you used in the query. That's why you should name with different names, similar columns in both tables.

Cheers,

Omar

culebrin 0 Junior Poster in Training

Hi everybody,

I want to make an app with command line parameters like: "dir *.jpg", when "dir" is the app and "*.jpg" is the parameter. Can anyone can help me.

culebrin 0 Junior Poster in Training

I have this code:

Dim cb As OleDb.OleDbCommandBuilder
        Try
            cb = New OleDb.OleDbCommandBuilder(daDocuments)
            daDocuments.Update(CType(bdsDocuments.DataSource, DataTable))
            MessageBox.Show("The data load has finished...", "DBF Load")
        Catch ex As Exception
            MessageBox.Show("1.- " + ex.Message)
        End Try

but, the OleDbCommandBuilder don't create the updatecommand and hence it doesn't work... any ideas?

culebrin 0 Junior Poster in Training

Thanks for your reply ptaylor965, !!

Well, first of all, I made a mistake about the component, Its a gridview; second of all, on which event do I put these codes? consider that my gridview its binded by design with a objectdatasource, and I can't change that.

Thanks again!!

Omar

for Dataview use

If dataview.count = 0 then
button1.visible = False
else
button1.visible = True
End If

or
for datatables use

If datatable.rows.count = 0 then 
button1.visible = False
else
button1.visible = True
End If