Set values from database when embedding Flash (SWF) file using EMBED in ASP.Net

Last Reply on Jan 28, 2014 10:52 PM By Priyanka12

Posted on Jan 28, 2014 01:59 AM

I have this html code for embedding a CCTV camera in my aspx page:

<object id="VACtrl2" width="800" height="600" classid="CLSID:70EDCF63-CA7E-4812-8528-DA1EA2FD53B6" codebase="\VitaminCtrl_4.0.0.8.cab#version=3,0,0,12">
    <param name="ClickEventHandler" value="1" runat="server"/>
    <param id="Param1" name="UserName" value="root" runat="server"/>
    <param id="Param2" name="Password" value="" runat="server"/>
    <param id="Param3" name="RemoteIPAddr" value="" runat="server"/>
    <param id="Param4" name="HttpPort" value="80" runat="server"/>
    <param id="Param5" name="DisplayErrorMsg" value="false" runat="server"/>
    </object>

I want to set the 3rd parameters value i.e., Param3 from my C# code-behind using database table (i.e., the path to the file to be view).

This 'Param3' name= 'RemoteIPAddress' field is there in database table (as below)

Id

IP Address

1

10.9.84.222

2

100.153.1.1

3

169.254.0.99

4

100.0.1.4

5

169.254.0.90

How to achieve it.

Please reply.



Posted on Jan 28, 2014 02:40 AM

This Way:

//set the property with your data
    protected string IpAddress = "198.169.11.10";
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }  

HTML:

<form id="form1" runat="server">
    <div>
        <object id="VACtrl2" width="800" height="600" classid="CLSID:70EDCF63-CA7E-4812-8528-DA1EA2FD53B6"
            codebase="\VitaminCtrl_4.0.0.8.cab#version=3,0,0,12">
            <param id="Param1" name="ClickEventHandler" value="1" runat="server" />
            <param id="Param2" name="UserName" value="root" runat="server" />
            <param id="Param3" name="Password" value='<%=this.IpAddress%>' />
            <param id="Param4" name="RemoteIPAddr" value="" runat="server" />
            <param id="Param5" name="HttpPort" value="80" runat="server" />
            <param id="Param6" name="DisplayErrorMsg" value="false" runat="server" />
        </object>
    </div>
    </form>

Thank You.


Posted on Jan 28, 2014 10:04 PM

Make use of Property value as i have used and set the property value by this value

dataSet1.Tables[0].Rows[0][0].ToString();

Thank You.


Posted on Jan 28, 2014 10:52 PM

@Azim

Thankyou for the help sir.

Below code is working fine:

private void CCTV()
        {
            int id = Convert.ToInt32(Request.QueryString["cameraid"].ToString());
            string query = "SELECT IPAddress FROM CCTVTable where Id='" + id + "'";
            DataSet dataSet1 = DataManager.DatabaseManager.GetOrCreateConnection(DataManager.DatabaseManager.ConnectionType.MySQL).GetData(query);
            Param3.Attributes["value"] = dataSet1.Tables[0].Rows[0][0].ToString();
        }

 

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html