sql server

Mattepuffo's logo
Corrispondenza tra tipi Sql Server e C#

Corrispondenza tra tipi Sql Server e C#

Capita spesso di avere un dato di un certo tipo in Sql Server e d doverlo convertire in un tipo C# o viceversa.

A volte è abbastanza intutuivo.

Altra volte decisamente meno.

Ho pensato di raccogliere le varie corrispondenze che mi sono servite e ho trovato, per poi aggiungere quelle mancanti al bisogno.

Non vuole essere una guida definitiva (molti tipi non ho mai avuto bisogno di usarli e quindi non ho cercato).

E non mi soffermo a spiegare i vari tipi.

Ci ho messo solo la corrispondenza.

Ovviamente i tipi in Visual Basic dovrebbere essere praticamente uguali, ma non conoscendo il VB non mi espongo.

Mattepuffo's logo
Inserimento dati con Stored Procedure in Asp.NET

Inserimento dati con Stored Procedure in Asp.NET

E' stata una dura lotta tra me e chiccosimo (utente del forum aspitalia) contro un FormView e l'inserimento dati in un db Sql Server.

Il problema era che i campi FK di questa tabella finiscono con # e questo creava probemi con l'inserimento attraverso FormView.

Abbiamo provato con dei metodi per valorizzare quei text box ma senza risultato.

Alla fine ho risolto facendo tutto a mano.

Dentro la pagina ho creato questa tabella:

<asp:Table ID="insertForm" runat="server">
<asp:TableRow runat="server">
<asp:TableCell runat="server">Descrizione:
</asp:TableCell>
<asp:TableCell runat="server">
<asp:TextBox ID="descrizione" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow1" runat="server">
<asp:TableCell ID="TableCell1" runat="server">Gruppo#:
</asp:TableCell>
<asp:TableCell ID="TableCell2" runat="server">
<asp:TextBox ID="gruppo" runat="server">69</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow2" runat="server">
<asp:TableCell ID="TableCell3" runat="server">Tipo deploy#:
</asp:TableCell>
<asp:TableCell ID="TableCell4" runat="server">
<asp:TextBox ID="tipo_deploy" runat="server">3</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow3" runat="server">
<asp:TableCell ID="TableCell5" runat="server">Localita:
</asp:TableCell>
<asp:TableCell ID="TableCell6" runat="server">
<asp:TextBox ID="localita" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow4" runat="server">
<asp:TableCell ID="TableCell7" runat="server">IP:
</asp:TableCell>
<asp:TableCell ID="TableCell8" runat="server">
<asp:TextBox ID="ip" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow5" runat="server">
<asp:TableCell ID="TableCell9" runat="server">Riserva:
</asp:TableCell>
<asp:TableCell ID="TableCell10" runat="server">
<asp:TextBox ID="riserva" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow6" runat="server">
<asp:TableCell ID="TableCell11" runat="server">Tipo connessione#:
</asp:TableCell>
<asp:TableCell ID="TableCell12" runat="server">
<asp:TextBox ID="tipo_connessione" runat="server">3</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow7" runat="server">
<asp:TableCell ID="TableCell13" runat="server">TGU:
</asp:TableCell>
<asp:TableCell ID="TableCell14" runat="server">
<asp:TextBox ID="tgu" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow8" runat="server">
<asp:TableCell ID="TableCell15" runat="server">IP inizio range:
</asp:TableCell>
<asp:TableCell ID="TableCell16" runat="server">
<asp:TextBox ID="ip_inizio_range" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow9" runat="server">
<asp:TableCell ID="TableCell17" runat="server">IP fine range:
</asp:TableCell>
<asp:TableCell ID="TableCell18" runat="server">
<asp:TextBox ID="ip_fine_range" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow10" runat="server">
<asp:TableCell ID="TableCell19" runat="server">Subnet:
</asp:TableCell>
<asp:TableCell ID="TableCell20" runat="server">
<asp:TextBox ID="subnet" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow11" runat="server">
<asp:TableCell ID="TableCell21" runat="server">Gateway:
</asp:TableCell>
<asp:TableCell ID="TableCell22" runat="server">
<asp:TextBox ID="gateway" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow12" runat="server">
<asp:TableCell ID="TableCell23" runat="server">Traffico prepagato:
</asp:TableCell>
<asp:TableCell ID="TableCell24" runat="server">
<asp:TextBox ID="traffico_prepagato" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow13" runat="server">
<asp:TableCell ID="TableCell25" runat="server">Costo traffico eccesso:
</asp:TableCell>
<asp:TableCell ID="TableCell26" runat="server">
<asp:TextBox ID="costo_traffico_eccesso" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow14" runat="server">
<asp:TableCell ID="TableCell27" runat="server">Costo forfait:
</asp:TableCell>
<asp:TableCell ID="TableCell28" runat="server">
<asp:TextBox ID="costo_forfait" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow15" runat="server">
<asp:TableCell ID="TableCell29" runat="server">IP router:
</asp:TableCell>
<asp:TableCell ID="TableCell30" runat="server">
<asp:TextBox ID="ip_router" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow16" runat="server">
<asp:TableCell ID="TableCell31" runat="server">IP watchdog
</asp:TableCell>
<asp:TableCell ID="TableCell32" runat="server">
<asp:TextBox ID="ip_watchdog" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow17" runat="server">
<asp:TableCell ID="TableCell33" runat="server">IP ups
</asp:TableCell>
<asp:TableCell ID="TableCell34" runat="server">
<asp:TextBox ID="ip_ups" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow18" runat="server">
<asp:TableCell ID="TableCell35" runat="server">IP camera
</asp:TableCell>
<asp:TableCell ID="TableCell36" runat="server">
<asp:TextBox ID="ip_camera" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow19" runat="server">
<asp:TableCell ID="TableCell37" runat="server">Directory satellite:
</asp:TableCell>
<asp:TableCell ID="TableCell38" runat="server">
<asp:TextBox ID="directory_satellite" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow20" runat="server">
<asp:TableCell ID="TableCell39" runat="server">Directory monitor:
</asp:TableCell>
<asp:TableCell ID="TableCell40" runat="server">
<asp:TextBox ID="directory_monitor" runat="server">0</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow21" runat="server">
<asp:TableCell ID="TableCell41" runat="server">Tipologia monitor#:
</asp:TableCell>
<asp:TableCell ID="TableCell42" runat="server">
<asp:TextBox ID="tipologia_monitor" runat="server">2</asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow ID="TableRow22" runat="server">
<asp:TableCell ID="TableCell43" runat="server">Submit
</asp:TableCell>
<asp:TableCell ID="TableCell44" runat="server">
<asp:Button ID="Submit" runat="server" Text="Submit" OnClick="insertData" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>