Retreive Html Code From Xmlfile, Insert Into Table

Nov 15, 2007

I use the following query to shred an xml and insert it into a table, but I want to have the whole html structure into the column to be able to present the formatted text in Cognos 8 BI.

WITH xmlnamespaces('http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-01-15T13:29:33' AS my)
INSERT INTO TMP_ATGFORSLAG (AtgForslagDesc)
SELECT
AtgForslagRad.value('(/my:AtgForslagRad/my:AtgForslagDesc)[1]', 'varchar(2000)') AS AtgForslagDesc
FROM dbo.DeklAtgForslagXml

The structure of the source in the xmlfile I want to import is:
<my:AtgForslagDesc>
<html xmlns="http://www.w3.org/1999/xhtml">
<ol>
<li>Text1...</li>
<li>Text2...</li>
<li>Text3...</li>
</ol>
</html>
</my:AtgForslagDesc>

How do I shred not only the text but the whole starting <html> to finishing </html> and insert it into a table I would be very happy.

View 1 Replies


ADVERTISEMENT

Insert HTMl Code In Database

Feb 23, 2008

Hello,

I am creating an ASP.NET web site which inserts data in a SQL database using LINQ.

One table column will hold HTML code. I am using a simple TextBox to input the data.

I would like to create my text in my computer and then copy/paste the HTML code to my TextBox and insert in the database.

What software should I use to create my text? Microsoft Office 2007, ... ? Any suggestion would be great.

Can I do it this way?

Thanks,

Miguel

View 9 Replies View Related

How To Have HTML Formatting Code In Database [SP]

Aug 2, 2007

i want to return a Log of my stored procedure to my asp app, how do i do that i have problems with that i tried Dim log As String = cmd.Parameters("@Log").ToString but that gave "An SqlParameter with ParameterName '@Log' is not contained by this
SqlParameterCollection."my code below SQL 1 ALTER PROCEDURE dbo.RevertDB
2 (
3 @Log varchar(MAX) = NULL OUTPUT
4 )
5
6 /* Reverts Database to original "Clean" State */
7 AS
8 SET NOCOUNT OFF
9 DECLARE @RowsInDB AS int
10 SET @Log = 'RevertDB Started at ' + CAST(GETDATE() AS varchar(50)) + '<br />'
11
12 /* *** Disable Constraints ***
13 ALTER TABLE Booking NOCHECK CONSTRAINT ALL
14 ALTER TABLE InventoryPC NOCHECK CONSTRAINT ALL
15 ALTER TABLE PC NOCHECK CONSTRAINT ALL
16 ALTER TABLE Platform NOCHECK CONSTRAINT ALL*/
17
18 /* *** Start Deletes *** */
19 DELETE FROM Booking
20 SET @Log = @Log + 'Clear Table Booking - Done' + '<br />'
21 SET @RowsInDB = (SELECT COUNT(BookingID) FROM Booking)
22 SET @Log = @Log + '-- Rows Affected: ' + CAST(@@ROWCOUNT AS varchar(10)) + ', Rows in Table: ' + CAST(@RowsInDB AS varchar(10)) + '<br />'
23
24 DELETE FROM InventoryPC
25 SET @Log = @Log + 'Clear Table InventoryPC - Done' + ''
26 SET @RowsInDB = (SELECT COUNT(InventoryID) FROM InventoryPC)
27 SET @Log = @Log + '-- Rows Affected: ' + CAST(@@ROWCOUNT AS varchar(10)) + ', Rows in Table: ' + CAST(@RowsInDB AS varchar(10)) + '<br />'
28
29 DELETE FROM PC
30 SET @Log = @Log + 'Clear Table PC - Done' + '<br />'
31 SET @RowsInDB = (SELECT COUNT(PCID) FROM PC)
32 SET @Log = @Log + '-- Rows Affected: ' + CAST(@@ROWCOUNT AS varchar(10)) + ', Rows in Table: ' + CAST(@RowsInDB AS varchar(10)) + '<br />'
33
34 DELETE FROM Platform
35 SET @Log = @Log + 'CLear Table Platform - Done' + ''
36 SET @RowsInDB = (SELECT COUNT(PlatformID) FROM Platform)
37 SET @Log = @Log + '-- Rows Affected: ' + CAST(@@ROWCOUNT AS varchar) + ', Rows in Table: ' + CAST(@RowsInDB AS varchar(10)) + '<br />'
38
39 /* *** Enable Constraints ***
40 ALTER TABLE Booking WITH CHECK CHECK CONSTRAINT ALL
41 ALTER TABLE InventoryPC WITH CHECK CHECK CONSTRAINT ALL
42 ALTER TABLE PC WITH CHECK CHECK CONSTRAINT ALL
43 ALTER TABLE Platform WITH CHECK CHECK CONSTRAINT ALL*/
44
45 SET @Log = @Log + '*** End Truncates ***' + '<br />'
46 /* *** End Truncates *** */
47
48 /* *** Start Insert Platform *** */
49 SET @Log = @Log + 'Start Insert Platform' + '<br />'
50
51 EXEC dbo.InsertPlatfrom 'Windows XP SP2 Professional Edition', 'Some description for Windows XP SP2 Professional Edition over here …'
52 EXEC dbo.InsertPlatfrom 'Windows Vista Ultimate', 'See everything you''re working on more clearly with Windows Aero, and quickly switch between windows or tasks using Windows Flip 3D and Live Thumbnails. You can easily find what you need—when you need it―with Instant Search and live icon previews that display the actual contents of your files. And while you''re at it, give your personal productivity a boost with instant access to the information you care about using Windows Sidebar and Gadgets. Put these easy-to-use and customizable mini-applications on your desktop and reveal the information you''re looking for at a glance. Website: http://www.microsoft.com/windows/products/windowsvista/seeit/default.mspx'
53 EXEC dbo.InsertPlatfrom 'Apple Mac OS X Tiger', 'Some description for Apple Mac OS X Tiger over here …'
54 EXEC dbo.InsertPlatfrom 'Apple Mac OS X Leopard', 'Desktop: The new look of Leopard showcases your favorite desktop image and puts new file Stacks at your fingertips for a stunning, clutter-free workspace. Finder: Browse your files like you browse your music with Cover Flow. Time Machine: See how your system looked on any given day and restore files with a click. Website: http://www.apple.com/macosx/leopard/features/'
55 EXEC dbo.InsertPlatfrom 'Red Hat Linux', 'Some description for Red Hat Linux over here …'
56
57 SET @Log = @Log + 'Rows In Platform: ' + CAST((SELECT COUNT(PlatformID) FROM Platform) AS varchar(10)) + '<br />'
58 /* *** Start Insert PC *** */
59 SET @Log = @Log + 'Start Insert PC' + '<br />'
60
61 DECLARE @WinXP int, @WinVista int, @OSXTiger int, @OSXLeopard int, @RedHat int
62 SET @WinXP = (SELECT PlatformID FROM Platform WHERE Title = 'Windows XP SP2 Professional Edition')
63 SET @WinVista = (SELECT PlatformID FROM Platform WHERE Title = 'Windows Vista Ultimate')
64 SET @OSXTiger = (SELECT PlatformID FROM Platform WHERE Title = 'Apple Mac OS X Tiger')
65 SET @OSXLeopard = (SELECT PlatformID FROM Platform WHERE Title = 'Apple Mac OS X Leopard')
66 SET @RedHat = (SELECT PlatformID FROM Platform WHERE Title = 'Red Hat Linux')
67
68 EXEC dbo.InsertPC 'Fusion PC One', 'Description here ...', 'Intel Core2 Duo E6600 2.4 GHz 1066MHz', '1GB Dual Channel DDR2 667 SDRAM', '120GB SATA2 NCQ HDD', 'NVIDIA GeForce 8600 256MB GDDR3', '22" 3000:1 Wide Screen LCD', @WinXP
69 EXEC dbo.InsertPC 'Fusion PC Two', 'Description here ...', 'Intel Core2 Duo E6850 3 GHz 1333MHz', '2GB Dual Channel DDR2 800 SDRAM', '240GB SATA2 NCQ HDD', 'NVIDIA GeForce 8800 Ultra 256MB GDDR3 SLI', '24" 3000:1 Wide Screen LCD', @WinVista
70 EXEC dbo.InsertPC 'Fusion PC Three', 'Description here ...', 'AMD Athlon 64 X2 Dual Core 6000+ 3 GHz', '2GB Dual Channel DDR2 667 SDRAM', '240GB SATA2 NCQ HDD', 'ATI Radeon Cross Fire 2900 256MB GDDR3', '24" 3000:1 Wide Screen LCD', @WinVista
71 EXEC dbo.InsertPC 'Fusion X1', 'Description here ...', 'Intel Core2 Extreme Q6850 3 GHz 1333MHz', '6GB Dual Channel DDR2 800 SDRAM', '500GB SATA2 NCQ HDD', 'NVIDIA GeForce 8800 Ultra 256MB GDDR3 SLI', '30" 3000:1 Wide Screen LCD', @OSXLeopard
72 EXEC dbo.InsertPC 'Fusion X2', 'Description here ...', 'AMD Athlon 64 FX 74 3 GHz', '6GB Dual Channel DDR2 800 SDRAM', '500GB SATA2 NCQ HDD', 'NVIDIA GeForce 8900 Ultra SLI 256MB GDDR3', '30" 3000:1 Wide Screen LCD', @WinVista
73 EXEC dbo.InsertPC 'Fusion Tiger 1', 'Description here ...', 'Intel Core2 Duo E6600 2.4 GHz 1066MHz', '2GB Dual Channel DDR2 800 SDRAM', '120GB SATA2 NCQ HDD', 'NVIDIA GeForce 8600 256MB GDDR3 SLI', '22" 3000:1 Wide Screen LCD', @OSXTiger
74 EXEC dbo.InsertPC 'Fusion Linux 1', 'Description here ...', 'AMD Athlon 64 X2 6000+ 3 GHz', '1GB Dual Channel DDR2 800 SDRAM', '120GB SATA2 NCQ HDD', 'NVIDIA GeForce 8600 256MB GDDR3', '22" 3000:1 Wide Screen LCD', @RedHat
75
76 SET @Log = @Log + 'Rows In PC: ' + CAST((SELECT COUNT(PCID) FROM PC) AS varchar(10)) + '<br />'
77
78 /* *** Start Insert Inventory *** */
79 SET @Log = @Log + 'Start Insert Inventory' + '<br />'
80
81 DECLARE @F1 int, @F2 int, @F3 int, @FX1 int, @FX2 int, @FT1 int, @FR1 int
82 SET @F1 = (SELECT PCID FROM PC WHERE Title = 'Fusion PC One')
83 SET @F2 = (SELECT PCID FROM PC WHERE Title = 'Fusion PC Two')
84 SET @F3 = (SELECT PCID FROM PC WHERE Title = 'Fusion PC Three')
85 SET @FX1 = (SELECT PCID FROM PC WHERE Title = 'Fusion X1')
86 SET @FX2 = (SELECT PCID FROM PC WHERE Title = 'Fusion X2')
87 SET @FT1 = (SELECT PCID FROM PC WHERE Title = 'Fusion Tiger 1')
88 SET @FR1 = (SELECT PCID FROM PC WHERE Title = 'Fusion Linux 1')
89
90 EXEC dbo.InsertInventory 10, @F1, 2.5, 'iCluster Fusion One'
91 EXEC dbo.InsertInventory 10, @F2, 2.5, 'iCluster Fusion Two'
92 EXEC dbo.InsertInventory 10, @F3, 2.5, 'iCluster Fusion Three'
93 EXEC dbo.InsertInventory 6, @FX1, 6, 'iCluster Fusion X1'
94 EXEC dbo.InsertInventory 6, @FX2, 6, 'iCluster Fusion X2'
95 EXEC dbo.InsertInventory 10, @FT1, 3, 'iCluster Fusion Tiger One'
96 EXEC dbo.InsertInventory 30, @FR1, 2, 'iCluster Fusion Linux One'
97
98 SET @Log = @Log + 'Rows In Inventory: ' + CAST((SELECT COUNT(InventoryID) FROM InventoryPC) AS varchar(10))
99
100 RETURN @Log
  

View 11 Replies View Related

Hoe To Input HTML Code In A Database From Asp

Aug 17, 2000

I want to put HTML code in my ASP form and then input in to a database in SQL SERVER 7.0, but due to some syntax problems i can't be able to do it.
Please tell me how i'm gonna input a typical HTML code in Database field.
Thanx.

View 1 Replies View Related

Rendering HTML Code Stored In A SQL Database

Oct 8, 2007

I've got a simple gridview and detailsview set up so the details view shows the selected item in gridview. But one of the fields contains HTML code and it's being displayed instead of rendered. There must be some easy way to use a panel or some other control and tell it dynamically what HTML to render, right?
I saw one other post where someone suggested using a third party html editor like fckeditor but that just seems ugly and I really don't care to spend the time installing and configuring someone else's control for such a simple thing.
Maybe I can assign the field to a variable and then response.write it? But then I can't change it dynamically based on my gridview selection...
Any ideas?

View 5 Replies View Related

Retreive A Table-Urgent

Mar 30, 2001

Hi,Is it possible to retrieve a single table from a backup in SQL 7.0?
TIA
Jay

View 1 Replies View Related

Want To Retreive Update Row In Table

May 10, 2007

i want to insert a row from t1 to t2 if any of the row is updated in the t1. say if Nth row is updated then the values of the row should be inserted into t2. inside the trigger i need to retrieve the row which is updated, how to do it? any specific global variable like @@identity is there for updation?

View 6 Replies View Related

How To Retreive Data From Excel To SQL SERVER Database Table

Oct 6, 2007

Hi Friends,
I am Using SQL SERVER 2005
I need to retreive data from Excel file to SQLSERVER table..
Thanks in advance
Regards
Rajkumar.M 
 
 

View 1 Replies View Related

How To Retreive Data From Excel Into SQLSERVER Database Table

Oct 6, 2007

Hi friends,
I need to retreive data from Excel into SQLSERVER database table
give me reply asap.
Thanks in advance...

View 4 Replies View Related

Insert Html In Mssql

Oct 30, 2007

 Hello Everybody,In my web application I have to insert html from editor. I have assigned the filed as "nvarchar". But after running the insert query it throws an error "A potentially dangerous Request.Form value was detected from the client
(oEdit1="<P><SPAN style="FONT...").  " I'm using WYSWYG editor. I'm now quite bit confused about the the field and the query. If you have any idea about the problem please help me out of this problem.Thanks in option.Regards--Arindam 

View 3 Replies View Related

Insert A Variable Into HTML Body?

Oct 18, 2013

I have created a .bat file for my sqlcmd

my sqlcmd includes a .sql file that builds up my email with a HTML body.

Is it possible to insert a variable (@customername) into the HTML body?

I am already using @maillist and select statement to create my customer email address's.

View 5 Replies View Related

Insert :) I Have Different Insert Code Lines (2 Insert Codelines) Which One Best ?

Jun 4, 2008

hello friends
my one insert code lines is below :) what does int32 mean ? AND WHAT IS DIFFERENT BETWEEN ONE CODE LINES AND SECOND CODE LINES :)Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Dim cmd As New SqlCommand("Insert into table1 (UserId) VALUES (@UserId)", conn)
'you should use sproc instead
cmd.Parameters.AddWithValue("@UserId", textbox1.text)
'your value
Try
conn.Open()Dim rows As Int32 = cmd.ExecuteNonQuery()
conn.Close()Trace.Write(String.Format("You have {0} rows inserted successfully!", rows.ToString()))
Catch sex As SqlExceptionThrow sex
Finally
If conn.State <> Data.ConnectionState.Closed Then
conn.Close()
End If
End Try
MY SECOND INSERT CODE LINES IS BELOWDim SglDataSource2, yeni As New SqlDataSource()
SglDataSource2.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ToString
SglDataSource2.InsertCommandType = SqlDataSourceCommandType.Text
SglDataSource2.InsertCommand = "INSERT INTO urunlistesi2 (kategori1) VALUES (@kategori1)"
SglDataSource2.InsertParameters.Add("kategori1", kategoril1.Text)Dim rowsaffected As Integer = 0
Try
rowsaffected = SglDataSource2.Insert()Catch ex As Exception
Server.Transfer("yardim.aspx")
Finally
SglDataSource2 = Nothing
End Try
If rowsaffected <> 1 ThenServer.Transfer("yardim.aspx")
ElseServer.Transfer("urunsat.aspx")
End If
 
 
cheers

View 2 Replies View Related

How To Show Description In Report Instead Of Code (Desc For Code Is In Master Table)

Mar 28, 2007

Dear Friends,



I am having 2 Tables.

Table 1: AddressBook
Fields --> User Name, Address, CountryCode



Table 2: Country
Fields --> Country Code, Country Name


Step 1 : I have created a Cube with these two tables using SSAS.



Step 2 : I have created a report in SSRS showing Address list.

The Column in the report are User Name, Address, Country Name



But I have no idea, how to convert this Country Code to Country name.

I am generating the report using the Layout tab. ( Data | Layout | Preview ) Report1.rdl [Design]



Anyone help me to solve this issue. Because, in our project most of the transaction tables have Code and Code description in master table. I need to convert all code into corresponding description in all my reports.




Thanks in advance.





Regards
Ramakrishnan
Singapore
28 March 2007

View 4 Replies View Related

Display HTML Codes As HTML And Not Text

Jan 15, 2008

I am retrieving a field from SQL and displaying that data on a web page.
The data contains a mixture of text and html codes, like this "<b>test</b>".
But rather than displaying the word test in bold, it is displaying the entire sting as text.
How do I get it to treat the HTML as HTML?

View 6 Replies View Related

SQL XML :: HTML Table With Alternative Row Color

Apr 27, 2015

I want to send out an email and the email body contains a table with data. I am using SQL to create the HTML table and to populate values inside the table. Below is the code I have so far

DECLARE
@HTML NVARCHAR(MAX)
;
IF (SELECT
COUNT(*)
from Employee])
!= 0

[Code] ....

But I am having trouble generating alternative colors for each row (tr:nth-of-type(odd) is not working for me)

Below is what the table should look like ....

View 2 Replies View Related

Pivot Table In HTML Output

Jan 21, 2008

Hi Friends,
I am new to reporting services . In Excel reports we can create pivot tables and manipulate data easily. Is it possible to create the pivot table in HTML output in SQL Server 2005 without changing the existing procedure or function? I wonder if there is any drag and drop facility to do the same in HTML report. Hope , some one might have dealt with this.

Regards,
Bhushan

View 1 Replies View Related

Query Result In HTML Table Format

Mar 21, 2008



Is there any way can I get the 'SELECT' query result in table format? I want to email the query result so that they can read it very easily.
Thank you,
Gish

View 15 Replies View Related

Reporting Services :: HTML Table Not Rendering In SSRS

Apr 5, 2011

I have some HTML stored in a SQL Server table that I want to render in Reporting Services 2008,

HTML data contain HTML table. While generating report, SSRS not able to render it properly as table.

How we can display the HTML data as it is in SSRS 2008?

View 4 Replies View Related

How To Present HTML Data From The Database Table In A Report

Jan 30, 2007

I have a comments field in database table which holds all html data, like bold chars and underline and with fonts etc.

Is it possible to show that data in the report or do i have to extract the data only by excluding all html / font tags etc.

Please help thank you very much.

View 1 Replies View Related

Show The Rows Containing Same Values Rate As Column In Html Table

Mar 27, 2008

Hi All,

I have following problem
please help me to resolve it.

There is table for shipping
as follows:




City


Kg


Rate(rs)




Rajkot


1


25.00




Rajkot


2


30.00




Rajkot


3


42.50




Ahemedabad


1


42.50




Ahemedabad


2


55.00




Ahemedabad


3


67.50




Ahemedabad


4


80.00




Goa


1


90.00




Goa


2


105.00




Goa


3


120.00




Gondal


1


25.00




Gondal


2


30.00




Gondal


3


42.50




Morbi


1


25.00




Morbi


2


30.00




Morbi


3


42.50




Gandhinagar


1


42.50




Gandhinagar


2


55.00




Gandhinagar


3


67.50




Gandhinagar


4


80.00




 We need to display
the table in html page using any Asp.Net language.

The result table should be:




City(s)


1


2


3


4




Rajkot,Gondal,Morbi


25.00


30.00


42.50


-




Ahemedabad,Gandhinagar


42.50


55.00


67.50


80.00




Goa


90.00


105.00


120.00


-




Baruch


70.25


80.00


92.00


120.50




 Description:

- Display all the cities
together for which all the shipping charges for (1-4) kgs are same. The range
of kgs is not fixed. 

Reply as soon as possible.

Thanks

View 3 Replies View Related

Store Procedure Saving HTML Text In Table Column

May 22, 2008

Hi All,I am looking for a store procedure or any alternate method which save my html file(s) text (with or without tags) in my table column automatically when I upload my html file to my file system (local hard drive).any help will be appreciate.Thanks in advance. 

View 7 Replies View Related

SQL Server 2012 :: Import Data From HTML Document Into Table

Oct 8, 2014

I have someone who is sending me .htm documents, with a table in them, and I was wondering if there is a way to import the data from those tables into a SQL table, probably using an SSIS Package.

View 4 Replies View Related

T-SQL (SS2K8) :: Send Multiple Rows With One HTML Table In Email?

Dec 2, 2014

I have a job below, which takes the results and send to the users in email.But I have a question, how can I send only one email with all rows, not to send the for every row on table separated email.

DECLARE @Body VARCHAR(MAX)
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
DECLARE @RowCountINT
DECLARE@idINT
declare@departmentnvarchar(30)

[code]....

View 2 Replies View Related

T-SQL (SS2K8) :: How To Display Stored Procedure Output In Html Table Format

Mar 16, 2014

i m creating one google map application using asp.net with c# i had done also now that marker ll be shown from database (lat,long)depends on the lat,long i wanna display customer,sales,total sales for each makers in html table format.

View 2 Replies View Related

Insert In SQL Server C# Code

Feb 7, 2005

When someone clicks my form
i use this code to enter data in Server:

private void Submit_Click(object sender, System.EventArgs e)
{
SqlConnection con = null;
SqlCommand cmd = null;
SqlDataReader rd = null;

try
{
con = new SqlConnection("server=localhost; uid=sa; pwd=123; database=TaskManagement");
cmd = new SqlCommand("INSERT INTO TASK_TYPE (name) VALUES ("+name.Text+")", con);

con.Open();
rd = cmd.ExecuteQuery();


}
catch (Exception e)
{
Response.Write("<p><font color="red">Error: ");
Response.Write(e.Message);
Response.Write("</font></p>");
}
finally
{
if(rd != null)
rd.Close();
if(con != null)
con.Close();
}
}


is that right? I am new in c# and i try to make it work!
Thanks in advance!

View 2 Replies View Related

SQL 2005 Insert Code Help Required

Dec 21, 2007

Hi I am trying to inset data to my sql 2005 database using a webform.. the code I have is
  3    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 4    5    ConnectionString="<%$ ConnectionStrings:SQL2005440975 %>" 6    7    InsertCommand="INSERT INTO [dbo.asp.net_Addresstbl] ([Salutation], [fname], [sname], [Daydb], [Monthdb], [Yeardb], [txtOrg], [txtLine1], [txtLine2], [txtLine3], [txtTown], [txtPostcode], [UserID]) 8    9    VALUES (@Salutation, @fname, @sname, @Daydb, @Monthdb, @Yeardb, @txtOrg, @txtLine1, @txtLine2, @txtLine3, @txtTown, @txtPostcode, @UserID)" 10   11   <InsertParameters>12                                           <asp:FormParameter FormField="Salutation" Name="Salutation" Type="String" />13                                           <asp:FormParameter FormField="fname" Name="fname" Type="String" />14                                           <asp:FormParameter FormField="sname" Name="sname" Type="String" />15                                           <asp:FormParameter FormField="Daydb" Name="Daydb" Type="Decimal" />16                                           <asp:FormParameter FormField="Monthdb" Name="Monthdb" Type="String" />17                                           <asp:FormParameter FormField="Yeardb" Name="Yeardb" Type="Decimal" />18                                           <asp:FormParameter FormField="txtOrg"Name="txtOrg" Type="String" />19                                           <asp:FormParameter FormField="txtLine1" Name="txtLine1" Type="String" />20                                           <asp:FormParameter FormField="txtLine2" Name="txtLine2" Type="String" />21                                           <asp:FormParameter FormField="txtLine3" Name="txtLine3" Type="String" />22                                           <asp:FormParameter FormField="txtTown" Name="txtTown" Type="String" />23                                           <asp:FormParameter FormField="txtPostcode"Name="txtPostcode" Type="String" />24                                           <asp:FormParameter FormField="UserID" Name="UserID" Type="Object" />25   </InsertParameters>26   </asp:SqlDataSource>27   28   <asp:DropDownList ID="Salutation" runat="server" ValidationGroup="Address">29                                   <asp:ListItem>Choose One</asp:ListItem>30                                   <asp:ListItem>Mr.</asp:ListItem>31                                   <asp:ListItem>Mrs.</asp:ListItem>32                                   <asp:ListItem>Ms.</asp:ListItem>33                                   <asp:ListItem>Miss.</asp:ListItem>34                                   <asp:ListItem>Rev.</asp:ListItem>35                                   <asp:ListItem>Doc.</asp:ListItem>36                                   <asp:ListItem>Other.</asp:ListItem>37                               </asp:DropDownList>38   39   <asp:TextBox ID="fname" runat="server" CausesValidation="True"></asp:TextBox>40   41   <asp:TextBox ID="sname" runat="server" CausesValidation="True"></asp:TextBox>42   43   <asp:DropDownList ID="Daydb" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">44                                   <asp:ListItem>Day</asp:ListItem>45                                   <asp:ListItem>01</asp:ListItem>46                                   <asp:ListItem>02</asp:ListItem>47                                   <asp:ListItem>03</asp:ListItem>48                                   <asp:ListItem>04</asp:ListItem>49                                   <asp:ListItem>05</asp:ListItem>50                                   <asp:ListItem>06</asp:ListItem>51                                   <asp:ListItem>07</asp:ListItem>52                                   <asp:ListItem>08</asp:ListItem>53                                   <asp:ListItem>09</asp:ListItem>54                                   <asp:ListItem>10</asp:ListItem>55                                   <asp:ListItem>11</asp:ListItem>56                                   <asp:ListItem>12</asp:ListItem>57                                   <asp:ListItem>13</asp:ListItem>58                                   <asp:ListItem>14</asp:ListItem>59                                   <asp:ListItem>15</asp:ListItem>60                                   <asp:ListItem>16</asp:ListItem>61                                   <asp:ListItem>17</asp:ListItem>62                                   <asp:ListItem>18</asp:ListItem>63                                   <asp:ListItem>19</asp:ListItem>64                                   <asp:ListItem>20</asp:ListItem>65                                   <asp:ListItem>21</asp:ListItem>66                                   <asp:ListItem>22</asp:ListItem>67                                   <asp:ListItem>23</asp:ListItem>68                                   <asp:ListItem>24</asp:ListItem>69                                   <asp:ListItem>25</asp:ListItem>70                                   <asp:ListItem>26</asp:ListItem>71                                   <asp:ListItem>27</asp:ListItem>72                                   <asp:ListItem>28</asp:ListItem>73                                   <asp:ListItem>29</asp:ListItem>74                                   <asp:ListItem>30</asp:ListItem>75                                   <asp:ListItem>31</asp:ListItem>76                               </asp:DropDownList>77   78   <asp:DropDownList ID="Monthdb" runat="server" style="text-align: left">79                                   <asp:ListItem>Month</asp:ListItem>80                                   <asp:ListItem>January</asp:ListItem>81                                   <asp:ListItem>February</asp:ListItem>82                                   <asp:ListItem>March</asp:ListItem>83                                   <asp:ListItem>April</asp:ListItem>84                                   <asp:ListItem>May</asp:ListItem>85                                   <asp:ListItem>June</asp:ListItem>86                                   <asp:ListItem>July</asp:ListItem>87                                   <asp:ListItem>August</asp:ListItem>88                                   <asp:ListItem>September</asp:ListItem>89                                   <asp:ListItem>October</asp:ListItem>90                                   <asp:ListItem>November</asp:ListItem>91                                   <asp:ListItem Value="12">December</asp:ListItem>92                               </asp:DropDownList>93   94   <asp:DropDownList ID="Yeardb" runat="server" style="text-align: left" 95                                   OnSelectedIndexChanged="Year_SelectedIndexChanged" 96                                   DataSourceID="YearDataSource" DataTextField="Year" DataValueField="Year">97                                   <asp:ListItem Selected="True">Choose Year..</asp:ListItem>98   </asp:DropDownList>99         <asp:AccessDataSource ID="YearDataSource" runat="server" 100        DataFile="~/App_Data/year.mdb" SelectCommand="SELECT [Year] FROM [Year]">101        </asp:AccessDataSource>102                          103  <asp:TextBox ID="txtFind" runat="server" CausesValidation="True" ValidationGroup="address"></asp:TextBox>104  105  <asp:Button ID="btnFind" runat="server" Text="Find" 106       OnClick="btnFind_Click" ValidationGroup="address" 107           OnClientClick="lstProperties" />108                      109  110          <asp:ListBox ID="lstProperties" runat="server" AutoPostBack="True" 111                   OnSelectedIndexChanged="lstProperties_SelectedIndexChanged" Visible="False" 112                                  Width="200px"></asp:ListBox>113                          114                              <asp:TextBox ID="txtOrg" runat="server" OnTextChanged="txtOrg_TextChanged" 115                                  ReadOnly="True" ValidationGroup="address2" Visible="False"></asp:TextBox>116                          117                              <asp:TextBox ID="txtLine1" runat="server" ReadOnly="True" Visible="False"></asp:TextBox>118                          119                              <asp:TextBox ID="txtLine2" runat="server" ReadOnly="True" Visible="False"></asp:TextBox>120                          121                              <asp:TextBox ID="txtLine3" runat="server" ReadOnly="True" Visible="False"></asp:TextBox>122                          123                              <asp:TextBox ID="txtTown" runat="server" ReadOnly="True" Visible="False"></asp:TextBox>124                          125                              <asp:TextBox ID="txtPostcode" runat="server" ReadOnly="True" Visible="False"></asp:TextBox>126                          127                              <asp:Label ID="lblAddress" runat="server" CssClass="style9"></asp:Label>128                                          129                              <asp:Button ID="submitaddress" runat="server" Text="Add Details" 130                                  style="text-align: centre" CommandName="Submit" 131                                  ValidationGroup="address" PostBackUrl="~/MemberPages/account.aspx" />132  133  </asp:Content>
 Will this code work? if not can you explain why not and offer an example that will work. In the mean time I am reading up on these insert statements.
 
Regards
Mal

View 5 Replies View Related

Insert Country Code Into Columns

Nov 9, 2011

I am having a users table which contains "Mobile" column as well. I want a query to set the country code value by default into the column name so that the column should be updated with the mobile number along with the default country code.

View 10 Replies View Related

Optimization Of Unpivot / Insert Code

Sep 11, 2015

Trying to optimise the below query, I believe it's do with the estimated rows on the unpivot using Supratimes this seems to be the only sticking point.The query below is an example replicating what I'm trying to do in live, it takes around 2 seconds to run on my pc.

Create --drop --alter
Table #Actuals
(
Period1 FLOAT
, Period2 FLOAT
, Period3 FLOAT
, Period4 FLOAT

[code]....

View 8 Replies View Related

UPDATE INSERT Code Efficiency

Sep 17, 2005

Not sure what happened to my post, it seems to have disappeared. Here we go again. I have a stored procedure that I would like some feedback on, as I feel it may be inefficient as coded:

@ZUserID varchar(10)
AS
SET NOCOUNT ON

DECLARE @counter int
SET @counter = 0
WHILE @counter < 10
BEGIN
SET @counter = @counter + 1
IF EXISTS(SELECT * FROM tblWork WHERE UserID = @ZUserID And LineNumber = @counter)
BEGIN
UPDATE tblWork SET
TransID = Null,
TransCd = Null,
InvoiceNo = Null,
DatePaid = Null,
Adjustment = Null,
Vendor = Null,
USExchRate = Null
WHERE
UserID = @ZUserID And LineNumber = @counter
END
ELSE
INSERT INTO tblWork
(LineNumber,TransCd,UserID)
VALUES
(@counter,'P',@ZUserID)
END

View 2 Replies View Related

How Do I Retreive Id Of Just Inserted Row?

Nov 3, 2007

I'm creating a web application that has user input on 3 seperate pages. Each page prompts the user for specific information and at the bottom of the page the user will click on the "Submit" button to post the info from the form to the database table.
Once the user has submitted the first page of information how do I retrieve the ID from the CustID column of that row so I can use the Update function to add additional info to that row when the user clicks on the submit button on page 2 & 3. I don't want to hold all the information in variables until the end in case they bail out of the form.
TIA
Steve

View 7 Replies View Related

Retreive Records From Sqlserver

Oct 16, 2006

hey guys, i getting a minor problem here. Hope u guys may help me =) I would like to count all the records from a table ' member ' and store the value inside a variable ' iCnt ' i wrote like tis:cmd.commandtext = " select count(*) as total from member" dim iCnt = cmd.ExecuteScalar Hmm.. I am wondering whether my code is correct, it seem like cant work =(Any help is appreciated, thanks u guys. 

View 1 Replies View Related

Update Field Without Retreive

Jan 24, 2007

if a db field "mynum" of type int contains for example the number 543.Is there a way I can update this field without first selecting the value?so for example set the the current value to +1
 

View 1 Replies View Related

Retreive Only Part Of The Query?

Sep 16, 2004

Is there a chance to retreive let's say rows positioned from 30-70 if a query produced result that contains 100 rows?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved