Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Dynamically setting the MM:Insert Statement

Guest
Aug 29, 2007 Aug 29, 2007
Hello,
I'm trying to dynamically set the MM:Insert and MM:Update statements so I can insert/update a certain field in the database based on a computer's name. If the name starts with a "W" then it is a desktop and I want it to update the "Desktop" field, If it starts with an "L" then it is a Laptop and I want it to update the "Laptop" field. I was thinking of just replacing the entire statement based on the name, I couldn't see how to do it by just changing part of it. Is it possible to do this? I'm doing this in C# Asp.Net. Thanks for any help!
TOPICS
Server side applications
333
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2007 Aug 29, 2007
What you are asking is relatively simple if you write the SQL statement by
hand, bit probably not using the MM functions. If you are serious about
asp.net work then I would recommend you learning to hand code ADO statements
anyway.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"stilmas1025" <webforumsuser@macromedia.com> wrote in message
news:fb4lll$pgh$1@forums.macromedia.com...
> Hello,
> I'm trying to dynamically set the MM:Insert and MM:Update statements so I
> can
> insert/update a certain field in the database based on a computer's name.
> If
> the name starts with a "W" then it is a desktop and I want it to update
> the
> "Desktop" field, If it starts with an "L" then it is a Laptop and I want
> it to
> update the "Laptop" field. I was thinking of just replacing the entire
> statement based on the name, I couldn't see how to do it by just changing
> part
> of it. Is it possible to do this? I'm doing this in C# Asp.Net. Thanks for
> any
> help!
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 30, 2007 Aug 30, 2007
I figured that. Is there any talk of DW getting more serious about .NET? It is very weak in that area and it's been around for a while. I guess I'll have to move over to Visual Studio. Thanks for the reply!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 30, 2007 Aug 30, 2007
LATEST
Hello again,
I need some help. I recreated the SQL Inserts with VS 2005 and am not doing something right. I got this from MSDN on how to insert records using the SQLdataSource Control. Here's what I got, but I get an exception error Message: ORA-01036: illegal variable name/number. I know this is an Adobe forum, but this is a basic ASP.NET question. I'm queying WMI to retrieve computer information that I send to the TextBoxes. Any help would be appreciated.

protected void bnSubmit_click(object sender, EventArgs e)
{
SqlDataSource1.Insert();
}


<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CAT %>"
ProviderName="<%$ ConnectionStrings:CAT.ProviderName %>" SelectCommand='SELECT * FROM "HARDWARE"' InsertCommand="INSERT INTO HARDWARE(SERVICE_TAG, MANUFACTURER, MODEL, OS, SERVICE_PACK, PROC, RAM, HDD, LAN, LAN_MAC, WIFI, WIFI_MAC, HDD_SIZE) VALUES (@SERVICE_TAG,@MANUFACTURER,@MODEL,@OS,@SERVICE_PACK,@PROC,@RAM,@HDD,@LAN,@LAN_MAC,@WIFI,@WIFI_MAC,@HDD_SIZE)">
<insertparameters>
<asp:formparameter name="SERVICE_TAG" formfield="txtSt" Type="String" />
<asp:formparameter name="MANUFACTURER" formfield="txtMf" Type="String" />
<asp:formparameter name="MODEL" formfield="txtMd" Type="String" />
<asp:formparameter name="OS" formfield="txtOs" Type="String"/>
<asp:formparameter name="SERVICE_PACK" formfield="txtSp" Type="String" />
<asp:formparameter name="PROC" formfield="txtProc" Type="String"/>
<asp:formparameter name="RAM" formfield="txtMem" Type="String"/>
<asp:formparameter name="HDD" formfield="txtHdd" Type="String"/>
<asp:formparameter name="LAN" formfield="txtLan" Type="String"/>
<asp:formparameter name="LAN_MAC" formfield="txtLmac" Type="String"/>
<asp:formparameter name="WIFI" formfield="txtWlan" Type="String"/>
<asp:formparameter name="WIFI_MAC" formfield="txtLmac" Type="String"/>
<asp:formparameter name="HDD_SIZE" formfield="txtHds" Type="String"/>
</insertparameters>
</asp:SqlDataSource>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines