robossa
asked on
ASP.NET command to insert values in sql database: Compiler Error Message: BC30451: Name 'CommandType' is not declared.
Hello!! I have two questions:
1)Is the attached code the best way to insert data in sql database or you will reconmned to use another code?
2)Why it says Compiler Error Message: BC30451: Name 'CommandType' is not declared.
Code
<script runat="server">
sub Button1_click(Sender As Object, E As EventArgs)
Dim strConString As String
Dim conlinklogisticoNET As SqlConnection
strConString = ConfigurationSettings.AppS ettings( "conString" )
conlinklogisticoNET = New SqlConnection( strConString )
conlinklogisticoNET.Open()
Dim cmdinsert As SqlCommand
cmdinsert = New SqlCommand( "sp_MTotalPurchaseInsert" , conlinklogisticoNET)
cmdinsert.CommandType = CommandType.StoredProcedur e
Dim param1 as new sqlparameter
param1.parametername = "@ponumber_x"
param1.value = ponumber_x.text
cmdinsert.parameters.add(p aram1, sqltype.nvarchar, 50)
Dim param2 as new sqlparameter
param2.parametername = "@date_x"
param2.value = date_x.text
cmdinsert.parameters.add(p aram2, sqltype.smalldatetime, 4)
Dim param3 as new sqlparameter
param3.parametername = "@no_do"
param3.value = no_do.text
cmdinsert.parameters.add(p aram3, sqltype.nvarchar, 50)
Dim param4 as new sqlparameter
param4.parametername = "@do_date"
param4.value = do_date.text
cmdinsert.parameters.add(p aram4, sqltype.smalldatetiem, 4)
Dim param5 as new sqlparameter
param5.parametername = "@supplier_x"
param5.value = supplier_x.text
cmdinsert.parameters.add(p aram5, sqltype.nvarchar, 50)
Dim param6 as new sqlparameter
param6.parametername = "@address"
param6.value = address.text
cmdinsert.parameters.add(p aram6, sqltype.nvarchar, 50)
Dim param7 as new sqlparameter
param7.parametername = "@tel"
param7.value = tel.text
cmdinsert.parameters.add(p aram7, sqltype.nvarchar, 50)
Dim param8 as new sqlparameter
param8.parametername = "@fax"
param8.value = fax.text
cmdinsert.parameters.add(p aram8, sqltype.nvarchar, 50)
Dim param9 as new sqlparameter
param9.parametername = "@email"
param9.value = email.text
cmdinsert.parameters.add(p aram9, sqltype.nvarchar, 50)
Dim param10 as new sqlparameter
param10.parametername ="@contact"
param10.value = contact.text
cmdinsert.parameters.add(p aram10, sqltype.nvarchar, 50)
Dim param11 as new sqlparameter
param11.parametername = "@city"
param11.value = city.text
cmdinsert.parameters.add(p aram11, sqltype.nvarchar, 50)
Dim param12 as new sqlparameter
param12.parametername = "@country"
param12.value = country.text
cmdinsert.parameters.add(p aram12, sqltype.nvarchar, 50)
Dim param13 as new sqlparameter
param13.parametername = "@buyer"
param13.value = buyer.text
cmdinsert.parameters.add(p aram13, sqltype.nvarchar, 50)
Dim param14 as new sqlparameter
param14.parametername = "@job"
param14.value = job.text
cmdinsert.parameters.add(p aram14, sqltype.nvarchar, 50)
Dim param15 as new sqlparameter
param15.parametername ="@emailbuyer"
param15.value = emailbuyer.text
cmdinsert.parameters.add(p aram15, sqltype.nvarchar, 50)
Dim param16 as new sqlparameter
param16.parametername = "@telbuyer"
param16.value = telbuyer.text
cmdinsert.parameters.add(p aram16, sqltype.nvarchar, 50)
Dim param17 as new sqlparameter
param17.parametername = "@client_name"
param17.value = client_name.text
cmdinsert.parameters.add(p aram17, sqltype.nvarchar, 50)
Dim param18 as new sqlparameter
param18.parametername = "@division_x"
param18.value = division_x.text
cmdinsert.parameters.add(p aram18, sqltype.decimal, 9)
Dim param19 as new sqlparameter
param19.parametername = "@via"
param19.value = via.text
cmdinsert.parameters.add(p aram19, sqltype.nvarchar, 50)
Dim param20 as new sqlparameter
param20.parametername = "@incoterms"
param20.value = incoterms.text
cmdinsert.parameters.add(p aram20, sqltype.nvarchar, 50)
Dim param21 as new sqlparameter
param21.parametername = "@shipport"
param21.value = shipport.text
cmdinsert.parameters.add(p aram21, sqltype.nvarchar, 50)
Dim param22 as new sqlparameter
param22.parametername = "@shipdestiny"
param22.value = shipdestiny.text
cmdinsert.parameters.add(p aram22, sqltype.nvarchar, 50)
Dim param23 as new sqlparameter
param23.parametername = "@cargo"
param23.value = cargo.text
cmdinsert.parameters.add(p aram23, sqltype.nvarchar, 50)
Dim param24 as new sqlparameter
param24.parametername = "@viapriority"
param24.value = viapriority.text
cmdinsert.parameters.add(p aram24, sqltype.nvarchar, 50)
Dim param25 as new sqlparameter
param25.parametername = "@shipto"
param25.value = shipto.text
cmdinsert.parameters.add(p aram25, sqltype.nvarchar, 50)
Dim param26 as new sqlparameter
param26.parametername ="@billto"
param26.value = billto.text
cmdinsert.parameters.add(p aram26, sqltype.nvarchar, 50)
Dim param27 as new sqlparameter
param27.parametername = "@notes"
param27.value = notes.text
cmdinsert.parameters.add(p aram27, sqltype.nvarchar, 2000)
cmdinsert.executenonquery( )
conlinklogisticoNET.close( )
end sub
</script>
<html>
<head>
<link href="..\styles\stylesheet wl.css" type="text/css" rel="stylesheet" />
</head>
<body>
<form id="form" runat="server">
<table marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
<tbody>
<tr class="subtitle">
<td colspan="2">
<asp:Label id="poinfo" runat="server" width="240px">Orden de Compra</asp:Label></td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lponumber_x" runat="server">Orden Compra</asp:Label></td>
<td class="r">
<asp:TextBox id="ponumber_x" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ldate_x" runat="server">Fecha</asp: Label></td >
<td class="r">
<asp:TextBox id="date_x" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lno_do" runat="server">No Do</asp:Label>
</td>
<td class="r">
<asp:TextBox id="no_do" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ldo_date" runat="server">Fecha Do</asp:Label> </td>
<td class="r">
<asp:TextBox id="do_date" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="subtitle">
<td colspan="2">
<asp:Label id="supplierinfo" runat="server" width="245px">Informacin Proveedor</asp:Label></td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lsupplier_x" runat="server">Proveedor</ asp:Label> </td>
<td class="r">
<asp:TextBox id="supplier_x" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="laddress" runat="server">Dirección</ asp:Label> </td>
<td class="r">
<asp:TextBox id="address" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="ltel" runat="server">Teléfono</a sp:Label>< /td>
<td class="r">
<asp:TextBox id="Tel" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lfax" runat="server">Fax</asp:La bel></td>
<td>
<asp:TextBox id="fax" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lemail" runat="server">Email</asp: Label></td >
<td class="r">
<asp:TextBox id="email" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lcontact" runat="server">Contacto</a sp:Label>< /td>
<td class="r">
<asp:TextBox id="contact" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lcity" runat="server">Ciudad</asp :Label></t d>
<td class="r">
<asp:TextBox id="city" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lcountry" runat="server">Pais</asp:L abel></td>
<td class="r">
<asp:TextBox id="country" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="subtitle">
<td colspan="2">
<asp:Label id="buyerinfo" runat="server" width="245px">Información Comprador</asp:Label></td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lbuyer" runat="server">Comprador</ asp:Label> Comprador< /td>
<td class="r">
<asp:TextBox id="buyer" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ljob" runat="server">Cargo</asp: Label>Carg o</td>
<td class="r">
<asp:TextBox id="job" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lemailbuyer" runat="server">Email</asp: Label>Emai l
</td>
<td class="r">
<asp:TextBox id="emailbuyer" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ltelbuyer" runat="server">Tel</asp:La bel></td>
<td class="r">
<asp:TextBox id="telbuyer" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lclient_name" runat="server">Cliente</as p:Label></ td>
<td class="r">
<asp:TextBox id="client_name" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ldivision_x" runat="server">Código Empresa</asp:Label></td>
<td class="r">
<asp:TextBox id="division_x" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="subtitle">
<td>
<asp:Label id="shippinginfo" runat="server">Instruccion es de Embarque</asp:Label></td>
<td>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lvia" runat="server">Medio Transporte</asp:Label></td >
<td class="r">
<asp:TextBox id="via" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lincoterms" runat="server">Incoterms</ asp:Label> </td>
<td class="r">
<asp:TextBox id="incoterms" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lshipport" runat="server">Puerto Embarque</asp:Label></td>
<td class="r">
<asp:TextBox id="shipport" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lshipdestiny" runat="server">Puerto Destino</asp:Label></td>
<td class="r">
<asp:TextBox id="shipdestiny" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lcargo" runat="server">Transportad or</asp:La bel></td>
<td class="r">
<asp:TextBox id="cargo" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lviapriority" runat="server">Prioridad Transporte</asp:Label></td >
<td class="r">
<asp:TextBox id="viapriority" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lshipto" runat="server">Embarcar a</asp:Label></td>
<td class="r">
<asp:TextBox id="shipto" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lbillto" runat="server">Facturar a</asp:Label></td>
<td class="r">
<asp:TextBox id="billto" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lnotes" runat="server">Notas</asp: Label></td >
<td class="r">
<asp:TextBox id="notes" runat="server"></asp:TextB ox>
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lsystemdate" runat="server">Systemdate< /asp:Label ></td>
<td class="r">
<input type="hidden" name="systemdate" />
</td>
</tr>
<tr>
<td class="r" colspan="2">
<input type="reset" value="Reset" />
<asp:Button id="Button1" runat="server" onclick="Button1_click" Text="Submit"></asp:Button >
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
1)Is the attached code the best way to insert data in sql database or you will reconmned to use another code?
2)Why it says Compiler Error Message: BC30451: Name 'CommandType' is not declared.
Code
<script runat="server">
sub Button1_click(Sender As Object, E As EventArgs)
Dim strConString As String
Dim conlinklogisticoNET As SqlConnection
strConString = ConfigurationSettings.AppS
conlinklogisticoNET = New SqlConnection( strConString )
conlinklogisticoNET.Open()
Dim cmdinsert As SqlCommand
cmdinsert = New SqlCommand( "sp_MTotalPurchaseInsert" , conlinklogisticoNET)
cmdinsert.CommandType = CommandType.StoredProcedur
Dim param1 as new sqlparameter
param1.parametername = "@ponumber_x"
param1.value = ponumber_x.text
cmdinsert.parameters.add(p
Dim param2 as new sqlparameter
param2.parametername = "@date_x"
param2.value = date_x.text
cmdinsert.parameters.add(p
Dim param3 as new sqlparameter
param3.parametername = "@no_do"
param3.value = no_do.text
cmdinsert.parameters.add(p
Dim param4 as new sqlparameter
param4.parametername = "@do_date"
param4.value = do_date.text
cmdinsert.parameters.add(p
Dim param5 as new sqlparameter
param5.parametername = "@supplier_x"
param5.value = supplier_x.text
cmdinsert.parameters.add(p
Dim param6 as new sqlparameter
param6.parametername = "@address"
param6.value = address.text
cmdinsert.parameters.add(p
Dim param7 as new sqlparameter
param7.parametername = "@tel"
param7.value = tel.text
cmdinsert.parameters.add(p
Dim param8 as new sqlparameter
param8.parametername = "@fax"
param8.value = fax.text
cmdinsert.parameters.add(p
Dim param9 as new sqlparameter
param9.parametername = "@email"
param9.value = email.text
cmdinsert.parameters.add(p
Dim param10 as new sqlparameter
param10.parametername ="@contact"
param10.value = contact.text
cmdinsert.parameters.add(p
Dim param11 as new sqlparameter
param11.parametername = "@city"
param11.value = city.text
cmdinsert.parameters.add(p
Dim param12 as new sqlparameter
param12.parametername = "@country"
param12.value = country.text
cmdinsert.parameters.add(p
Dim param13 as new sqlparameter
param13.parametername = "@buyer"
param13.value = buyer.text
cmdinsert.parameters.add(p
Dim param14 as new sqlparameter
param14.parametername = "@job"
param14.value = job.text
cmdinsert.parameters.add(p
Dim param15 as new sqlparameter
param15.parametername ="@emailbuyer"
param15.value = emailbuyer.text
cmdinsert.parameters.add(p
Dim param16 as new sqlparameter
param16.parametername = "@telbuyer"
param16.value = telbuyer.text
cmdinsert.parameters.add(p
Dim param17 as new sqlparameter
param17.parametername = "@client_name"
param17.value = client_name.text
cmdinsert.parameters.add(p
Dim param18 as new sqlparameter
param18.parametername = "@division_x"
param18.value = division_x.text
cmdinsert.parameters.add(p
Dim param19 as new sqlparameter
param19.parametername = "@via"
param19.value = via.text
cmdinsert.parameters.add(p
Dim param20 as new sqlparameter
param20.parametername = "@incoterms"
param20.value = incoterms.text
cmdinsert.parameters.add(p
Dim param21 as new sqlparameter
param21.parametername = "@shipport"
param21.value = shipport.text
cmdinsert.parameters.add(p
Dim param22 as new sqlparameter
param22.parametername = "@shipdestiny"
param22.value = shipdestiny.text
cmdinsert.parameters.add(p
Dim param23 as new sqlparameter
param23.parametername = "@cargo"
param23.value = cargo.text
cmdinsert.parameters.add(p
Dim param24 as new sqlparameter
param24.parametername = "@viapriority"
param24.value = viapriority.text
cmdinsert.parameters.add(p
Dim param25 as new sqlparameter
param25.parametername = "@shipto"
param25.value = shipto.text
cmdinsert.parameters.add(p
Dim param26 as new sqlparameter
param26.parametername ="@billto"
param26.value = billto.text
cmdinsert.parameters.add(p
Dim param27 as new sqlparameter
param27.parametername = "@notes"
param27.value = notes.text
cmdinsert.parameters.add(p
cmdinsert.executenonquery(
conlinklogisticoNET.close(
end sub
</script>
<html>
<head>
<link href="..\styles\stylesheet
</head>
<body>
<form id="form" runat="server">
<table marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
<tbody>
<tr class="subtitle">
<td colspan="2">
<asp:Label id="poinfo" runat="server" width="240px">Orden de Compra</asp:Label></td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lponumber_x" runat="server">Orden Compra</asp:Label></td>
<td class="r">
<asp:TextBox id="ponumber_x" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ldate_x" runat="server">Fecha</asp:
<td class="r">
<asp:TextBox id="date_x" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lno_do" runat="server">No Do</asp:Label>
</td>
<td class="r">
<asp:TextBox id="no_do" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ldo_date" runat="server">Fecha Do</asp:Label> </td>
<td class="r">
<asp:TextBox id="do_date" runat="server"></asp:TextB
</td>
</tr>
<tr class="subtitle">
<td colspan="2">
<asp:Label id="supplierinfo" runat="server" width="245px">Informacin Proveedor</asp:Label></td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lsupplier_x" runat="server">Proveedor</
<td class="r">
<asp:TextBox id="supplier_x" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="laddress" runat="server">Dirección</
<td class="r">
<asp:TextBox id="address" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="ltel" runat="server">Teléfono</a
<td class="r">
<asp:TextBox id="Tel" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lfax" runat="server">Fax</asp:La
<td>
<asp:TextBox id="fax" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lemail" runat="server">Email</asp:
<td class="r">
<asp:TextBox id="email" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lcontact" runat="server">Contacto</a
<td class="r">
<asp:TextBox id="contact" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lcity" runat="server">Ciudad</asp
<td class="r">
<asp:TextBox id="city" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lcountry" runat="server">Pais</asp:L
<td class="r">
<asp:TextBox id="country" runat="server"></asp:TextB
</td>
</tr>
<tr class="subtitle">
<td colspan="2">
<asp:Label id="buyerinfo" runat="server" width="245px">Información Comprador</asp:Label></td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lbuyer" runat="server">Comprador</
<td class="r">
<asp:TextBox id="buyer" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ljob" runat="server">Cargo</asp:
<td class="r">
<asp:TextBox id="job" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lemailbuyer" runat="server">Email</asp:
</td>
<td class="r">
<asp:TextBox id="emailbuyer" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ltelbuyer" runat="server">Tel</asp:La
<td class="r">
<asp:TextBox id="telbuyer" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lclient_name" runat="server">Cliente</as
<td class="r">
<asp:TextBox id="client_name" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="ldivision_x" runat="server">Código Empresa</asp:Label></td>
<td class="r">
<asp:TextBox id="division_x" runat="server"></asp:TextB
</td>
</tr>
<tr class="subtitle">
<td>
<asp:Label id="shippinginfo" runat="server">Instruccion
<td>
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lvia" runat="server">Medio Transporte</asp:Label></td
<td class="r">
<asp:TextBox id="via" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lincoterms" runat="server">Incoterms</
<td class="r">
<asp:TextBox id="incoterms" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lshipport" runat="server">Puerto Embarque</asp:Label></td>
<td class="r">
<asp:TextBox id="shipport" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lshipdestiny" runat="server">Puerto Destino</asp:Label></td>
<td class="r">
<asp:TextBox id="shipdestiny" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lcargo" runat="server">Transportad
<td class="r">
<asp:TextBox id="cargo" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lviapriority" runat="server">Prioridad Transporte</asp:Label></td
<td class="r">
<asp:TextBox id="viapriority" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lshipto" runat="server">Embarcar a</asp:Label></td>
<td class="r">
<asp:TextBox id="shipto" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lbillto" runat="server">Facturar a</asp:Label></td>
<td class="r">
<asp:TextBox id="billto" runat="server"></asp:TextB
</td>
</tr>
<tr class="1">
<td class="l">
<asp:Label id="lnotes" runat="server">Notas</asp:
<td class="r">
<asp:TextBox id="notes" runat="server"></asp:TextB
</td>
</tr>
<tr class="2">
<td class="l">
<asp:Label id="lsystemdate" runat="server">Systemdate<
<td class="r">
<input type="hidden" name="systemdate" />
</td>
</tr>
<tr>
<td class="r" colspan="2">
<input type="reset" value="Reset" />
<asp:Button id="Button1" runat="server" onclick="Button1_click" Text="Submit"></asp:Button
</td>
</tr>
</tbody>
</table>
</form>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i agree with mrichmon. if it says CommandType is not declared, I imagine it is because of the line:
cmdinsert.CommandType = CommandType.StoredProcedur e
If the appropriate classes are not present, it doesn't know what CommandType is.
cmdinsert.CommandType = CommandType.StoredProcedur
If the appropriate classes are not present, it doesn't know what CommandType is.
ASKER
It is working after including imports system.data. Thanks a lot mrichmon. For genxerator, I kept the line cmdinsert thanks a lot.
smalldatetiem --> smalldatetime
I am looking at the error...