|
In sql server i have an table called "WW"
That table records i want to copy to XML file (WW.xml)
I done the SQL to XML like this
Dim dsn, sqlEmp As String
dsn = "Provider=SQLOLEDB;server=;uid=;pwd=;database=Test"
sqlEmp = "select * from WW"
Dim connection As New OleDbConnection(dsn)
Dim command As New OleDbDataAdapter(sqlEmp, connection)
Dim dsCustomers As New DataSet
command.Fill(dsCustomers, sqlEmp)
dsCustomers.WriteXml(Server.MapPath("WW.xml"))
It will transfer all the records to XML file
Now i want to this XML file to transfer to SQL server New Table
How can i do this
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
Hi Friend,
I Envisage the <new table=""> has two Columns.
Private Con As SqlConnection
Private Com As SqlCommand
Private DSET As DataSet
Con = New SqlConnection("Your Connection String")
Com = New SqlCommand("Insert <newtable> Values(@ID,@Name )", Con)
'/*** If the TWO column are String Type ***/
Com.Parameters.Add("@ID", SqlDbType.VarChar, 5)
Com.Parameters.Add("@Name", SqlDbType.VarChar, 50)
DSET = New DataSet()
DSET.ReadXml("<path here="">WW.xml")
Dim R As Int32
Con.Open()
For R = 0 To DSET.Tables(0).Rows.Count - 1
Com.Parameters("@ID").Value =DSET.Tables(0).Rows(R)(0)
Com.Parameters("@Name").Value =DSET.Tables(0).Rows(R)(1)
Com.ExecuteNonQuery()
Next
Con.Close()
With Regards,
Pandian S
|
|
|
|
|
Hi THX for reply
Plz can u chk u this what wrong here
It is giving this ERROR ------ Declare "@code"
Dim Con As OleDbConnection
Dim Com As OleDbCommand
Dim DSET As DataSet
Con = New OleDbConnection("Connection String")
Com = New OleDbCommand("Insert into ww Values(@Code,@Month))", Con)
Com.Parameters.Add("@Code", OleDbType.VarChar, 200, "@Code")
Com.Parameters.Add("@Month", OleDbType.VarChar, 200, "@Month")
DSET = New DataSet
DSET.ReadXml(Server.MapPath("WW.xml"))
Dim R As Int32
Con.Open()
For R = 0 To DSET.Tables(0).Rows.Count - 1
(ERROR) Com.Parameters("@Code").Value = DSET.Tables(0).Rows(R)(0)
Com.Parameters("@Month").Value = DSET.Tables(0).Rows(R)(1)
Com.ExecuteNonQuery()
Next
Con.Close()
-- modified at 2:00 Wednesday 16th August, 2006
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
plz help me to invoke the OnTextChanged event to the TextBox placed in the footer template of the grid.On changing the TextBox text property the corresponding data matching the to the text should be displayed it the adjacent rows ..
plz somebody help to goforward in my project
ashok kumar.y
|
|
|
|
|
How can I convert excel file,Word document file to pdf in asp.net
Mansoor
|
|
|
|
|
Why delete the previous message and then start a new thread? You should respond in the thread that you already started.
|
|
|
|
|
Hi!
I am using ASP.net 1.1 TextBox control, it has a "wrap" property which takes the sentence to the next line by adding a carriage return if the user reaches the end of a line. This property is not working with FireFox, can any one please help, how to code the TextBox control so that it's wrap property works with firefox as well.
Many Thanks in advance.
happy coding!
|
|
|
|
|
You are using a feature that is not part of the HTML standard, so it's not available in all browsers.
Let's take a step back. Why are you using this feature in the first place? What is it that you need it for?
---
b { font-weight: normal; }
|
|
|
|
|
Mansurali wrote: How do i convert any other file format to PDF in ASP.NET
ASP.NET is a framework for writing web applications (e.g. web sites and web services). You cannot use ASP.NET to convert files.
You can use other classes in the .NET Framework for this purpose if you want.
However, your request is too vague. For example, what file formats do you want to convert to PDF?
e.g. Do you want to convert:
* Autocad Drawings
* AVI files
* ESRI Shape Files
* C# source code files
* DLLs
* Executable files
* Excel spreadsheets
* HTML files
* .INI files
* ISO disk images
* MP3 files
* Powerpoint presentation
* WMA (Windows Media Audio) files
* WMV (Windows Media Vidio) files
* Word Documents
* XML files
* ZIP files
As you can see from this list, all these files are included in your request, but how, exactly, would you like an Executable File to be rendered into a PDF?
|
|
|
|
|
Colin,
You have answered to wrong posting .
happy coding!
|
|
|
|
|
No, I did not answer the wrong post. The person I replied to deleted their post and then posted it again (in a new thread) after you posted your post. It can all get rather confusing when people are inconsiderate like that.
|
|
|
|
|
I'm using the selectedIndex of a drop down list to determine if the user select an item
If dropdownlistMember.SelectedIndex > -1
do a bunch of stuff
else
send an error message to the user
Its a zero based drop down list
The problem is that SelectedIndex is never -1.
If I step through the code, when the user does not make a selection, the index is 0. If they select the first item, the index is 0 ( it should be)
If they select the second item, index is 1 ( it should be)
I tried initializing the index during page load if not post back
If Page.IsPostBack = False Then
dlIdNums.SelectedIndex = -1
But index is always 0
Any ideas?
thanks
|
|
|
|
|
Add a new item in the drop down with ' ' as the text and value as -1, that should be first item in the drop down. I was having the same problem i did this way.
Ram
|
|
|
|
|
great - thanks for the idea
|
|
|
|
|
can't get this to work
The drop down list is populated when the program is run ( by reading in records from a table)
I add a new item with text ' ' and value = '1
but when I step through the code, the first item always has an index = 0 even though I've just set it to -1
Don't understand how to change this
Even if no item is selected, the index is = 0 which means if no item is selected, the first item will always be selected
|
|
|
|
|
Hi,
I have a website on a dedicated web server that can't communicate with a sql server 2000 database sitting behind a firewall. My website is written in asp.net 2 and c# 2 and port 1433 has been opened through the firewall to allow access. On the db server is an admin database set up to use asp.net authentication. I am running Visual Web Dev 2005 Express on the web server to test the application and initially I want to connect to that db and set up mu app and asp 'admin' users. For that I would normally use the 'Website/ ASP.NET Configuration' menu option within the IDE. At the moment I just get a connection error:
Server Error in '/asp.netwebadminfiles' Application.
--------------------------------------------------------------------------------
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Server Error in '/asp.netwebadminfiles' Application.
--------------------------------------------------------------------------------
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL.
Error message 401.2.: Unauthorized: Logon failed due to server configuration. Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server. Contact the Web server's administrator for additional assistance.
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Now which server is the problem on - the web server?? What do I need to do to connect with this db? Help! Thanks in advance.
Chris
|
|
|
|
|
Hi! Chris
I am probably trying to do something which you may already have done. However, a very simple thing to start with, can you check under web site properties settings on IIS the following thing.
On the document tab, "enable default document" is cheked and the start up page is set up as the first web page.
Let me know if this didn't work.
Good luck.
happy coding!
|
|
|
|
|
Nope tried this, but no difference, still get the same error. I tried finding the IIS log but is seems pretty useless at the moment - not sure if I am looking at the wrong file - by default it seems to be in C:\WINDOWS\System32\LogFiles\W3SVC1 and only says something like:
#Software: Microsoft Internet Information Services 6.0
#Version: 1.0
#Date: 2006-08-11 10:56:02
#Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status time-taken
2006-08-11 10:56:02 W3SVC1 172.16.254.52 OPTIONS / - 80 - 172.16.0.236 Microsoft-WebDAV-MiniRedir/5.1.2600 200 0 0 125
2006-08-11 10:56:02 W3SVC1 172.16.254.52 PROPFIND /c$ - 80 - 172.16.0.236 Microsoft-WebDAV-MiniRedir/5.1.2600 501 0 0 31
Not much use to me - thought it would log whats causing the 401.2 error. Hmmm, any other ideas?
Chris.
|
|
|
|
|
Can you check under IIS website properties settings, what is the type of authenctication you have used? Has annonymous access been enabled?
happy coding!
|
|
|
|
|
In my web application i need to set Local Time for user, Where user will specefy timezone offset. Web site is resides in a server located in another country. So i like to do following steps
1. Get the current GMT DateTime in webserver
2. Add Offset specefied by the User.
3. return the local DateTime
How to code it in C#.
|
|
|
|
|
hi
i have to add month which is in integer form like (18 month) into the
Current date which i'm getting from Date.Today().
thanx
|
|
|
|
|
hi,
DateTime.Today.AddMonths(18)
|
|
|
|
|
Hi All
I have a tough one (for me that is).
I have written a web service that recieve SOAP messages from an embedded device and it works fine
I now need to get this information into a service on a server running in the back ground so that I can manipulate the data and in the end save it a SQL2005 db.
I have seen that when I receive SOAP udates from my embedded device the web service "fires" on each POST from the embedded device, This can be as much as 10 000 time per second, I can see all my data. My first idea was to allow the web service to udate the SQL2005 db directly but this process is to slow.
That is why I planning a service running on the same server as a process in the background.
Regards
|
|
|
|
|
I had a similar situation when I recieved a lot of web requests when doing statistics for a web site. I didn't solve it using a service, but with a thread.
I store the data in a static list, until the list gets to a specific age or a specific size. Then I start a thread that will loop through the list and save the data to the database, and create a new empty list to store new data in.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa
Good idea. Just one question. When the Web service is in the IIS environment will the werb service store the incomming info in memory and if so how do a separate thread or application retrive this data?
Regards
|
|
|
|