|
Hi,
There is one utility called SQLBULKCOPY but that is for sqlserver.
In asp.net 2.0, there is no as such utility for oracle.
My need is to transfer excel data to oracle?
Provide any solution.
|
|
|
|
|
|
I have opned an oledb connection to connect to oracle.
I am working in offline mode.
I fill up the dataset with excel data. Works fine.
Now I open oracle connection with oledb only.
Created oracle adpater also using oledbadapter.
Created the dataset. it contains no rows as table in oracle is empty.
Check the code below:
string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0";
OleDbConnection oledbConn = new OleDbConnection(connString);
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn);
OleDbDataAdapter oleda = new OleDbDataAdapter();
oleda.SelectCommand = cmd;
DataSet ds = new DataSet();
oleda.Fill(ds, "Sheet1");
OleDbConnection oledbConn1 = new OleDbConnection("Provider=MSDAORA;Data Source=mywork; User Id = system; Password =Infosys123");
OleDbCommand cmd1 = new OleDbCommand("SELECT * FROM excel_ora", oledbConn1);
OleDbDataAdapter oledb = new OleDbDataAdapter(cmd1);
DataSet ds1 = new DataSet();
oledb.Fill(ds1, "excel_ora");
ds1 = ds.Copy();
OleDbCommandBuilder oo = new OleDbCommandBuilder(oledb);
oledb.Update(ds1,"excel_ora");
//the above line thorws error as it does not find table "excel_ora"
Response.Write("hi");
|
|
|
|
|
//Code related to excel
string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0";
OleDbConnection oledbConn = new OleDbConnection(connString);
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn);
OleDbDataAdapter oleda = new OleDbDataAdapter();
oleda.SelectCommand = cmd;
DataSet ds = new DataSet();
oleda.Fill(ds, "excel_ora");
//Code related to Oracle
OleDbConnection oledbConn1 = new OleDbConnection("Provider=MSDAORA;Data Source=mywork; User Id = system; Password =Infosys123");
OleDbCommand cmd1 = new OleDbCommand("SELECT * FROM excel_ora", oledbConn1);
OleDbDataAdapter oledb = new OleDbDataAdapter(cmd1);
DataSet ds1 = new DataSet();
oledb.Fill(ds1, "excel_ora");
//Transfer excel dataset to oracle
ds1 = ds.Copy();
OleDbCommandBuilder oo = new OleDbCommandBuilder(oledb);
oledb.Update(ds1,"excel_ora");
Response.Write("hi");
-----------------------------------------------
Written aboce code. everything fine but data does not transfer to oracle. WHy?
|
|
|
|
|
|
I think asp.net 2.0 does not support this. I tried but not working.
|
|
|
|
|
Hi Friends,
i develop a website using asp.net it work perfectly when i run my application from VS2008.But i want my website as published one ie i want my application to run without VS2008 support.How i publish that and run in IIS Server. please help with your valuable ideas.
regards
Vasanth.A
|
|
|
|
|
Google suggested me all these [^]articles to do this.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Publish your website.Add a virtual directory in your IIS and target it to the published content.
|
|
|
|
|
|
On some sites like yahoo mail when you right click it seems to override the default webbrowser right click menu and show its own html type menu. How do they do this? Im presuming its some javascript ninja'ing?
BTW i put this in the ASP.NET board because I will be doing on an ASP.NET site.
Strive to be humble enough to take advice, and confident enough to do something about it.
|
|
|
|
|
Hi all,
Im getting a soap response from a server. the xml looks like:
<?xml version="1.0" ?>
- <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Body>
- <TN_DetailsResp xmlns="http://tempuri.org/">
<PersNr>2</PersNr>
<ProjCode>2</ProjCode>
<CardNr>2</CardNr>
</TN_DetailsResp>
</soap:Body>
</soap:Envelope>
How can i get a single element and display it in a label.
For example how to show the value of 'PersNr' in a label. Im using C#
|
|
|
|
|
This is so basic. You should go to Google and sreach for 'Read xml + c#'.
If you do not understand even after that, come back and show us what have you done. Some one would help you.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Are you going to make a Soap Response Parser?
I think .NET automatically creates them for you.
You need to Add Web Reference to your project and you will get everything as an Object.
|
|
|
|
|
Piya B wrote: How can i get a single element and display it in a label.
You can do that with XPath *easily*. Load the XML to a XmlDocument class work with SelectSingleNode() method.
string xPath = "/soap:Envelope/soap:Body/dummy:TN_DetailsResp/dummy:PersNr";
XmlDocument document = new XmlDocument();
document.Load("your_xml");
XmlNamespaceManager nm = new XmlNamespaceManager(document.NameTable);
nm.AddNamespace("dummy", "http://tempuri.org/");
nm.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");
XmlNode node = document.SelectSingleNode(xPath, nm);
string result = node.InnerText; XPath is bit tricky here as your XML involves namespaces. dummy is a namespace prefix which I introduced as TN_DetailsResp node doesn't have any prefix.
Hope that helps.
|
|
|
|
|
Thanks for response N a v a n e e t h,
I got this also by :
XmlDocument doc = new XmlDocument();
doc.LoadXml(message);
XmlNodeList persid = doc.GetElementsByTagName("PersNr");
for (int _i = 0; _i < persid.Count; ++_i)
{
}
Just wondering, what's the difference between this and your solution?
|
|
|
|
|
Your code will get all elements whose name is PersNr anywhere in the document. The XPath example which I provided will look only in soap:Envelope/soap:Body/TN_DetailsResp .
|
|
|
|
|
Hi All
I'm facing problem while update and delete Items from ListView , it's data source point a table has 2 columns and both are composite primary keys
I faced that error
ObjectDataSource 'CourseSubjectDataSourse' could not find a non-generic method 'UpdateCourseSubject' that has parameters: original_CourseID, SubjectID, original_SubjectID.
while my UpdateCourseSubject method in the business layer like that
Public Function UpdateCourseSubject(ByVal SubjectID As Integer, ByVal original_CourseID As Integer) As Boolean<br />
Dim taCourseSubject As New dsTracksTableAdapters.CourseSubjectTableAdapter<br />
Dim dtCourseSubject As dsTracks.CourseSubjectDataTable = taCourseSubject.GetDataByCourseID(original_CourseID)<br />
If dtCourseSubject.Rows.Count = 0 Then Return False<br />
Dim rCourseSubject As dsTracks.CourseSubjectRow = dtCourseSubject.Rows(0)<br />
rCourseSubject.CourseID = original_CourseID<br />
rCourseSubject.SubjectID = SubjectID<br />
<br />
Dim rowsAffected As Integer = taCourseSubject.Update(dtCourseSubject)<br />
Return rowsAffected = 1<br />
End Function<br />
<br />
End Class
and the query sql statement in the dataset and table adapter like :
UPDATE CourseSubject<br />
SET SubjectID = @SubjectID<br />
WHERE (CourseID = @Original_CourseID)
can any one tell me what is the problem :S ??
thanks in advance
|
|
|
|
|
Hi
I have a tabcontainer with 3 tab panels..
Tabcontainer Autopostback is set to true.
Flickering is happen while moving from one tab to other tab..
How to avoid this issue..
Anybody's help would be appreciated..
Thanks in advance..
|
|
|
|
|
may be you can try the AjaxController
|
|
|
|
|
Hello every one i have Tree View .i made a comtext menu on treeview.This contextmenu Having option like Add New,Edit,Delete.i got this ,But problem is that for add,edit,delete i have to get the selected node of Treeview.i am not getting the things.Please tell me the way.
|
|
|
|
|
use the below code to get selected treeview node text or value
For Each nodes As TreeNode In TreeView1.CheckedNodes
Response.Write(nodes.Text & "--" & nodes.Value & "")
Next
The miracle is this--the more we share, the more we have.
|
|
|
|
|
I uses the following code to dynamic fill the dropdownlist and forecolor of list item is set, it show good when first time load, but the style removes when the page postback...Any suggestion?
The code i use to fill dropdownlist is following...
Try
cnn.Open()
myreader = cmd.ExecuteReader()
While myreader.Read()
lst = New ListItem(myreader.GetValue(0).ToString().Trim(), myreader.GetValue(1).ToString().Trim())
If myreader.GetValue(2).ToString().Trim() = 0 Then
lst.Attributes.Add("style", "color:Red")
Else
lst.Attributes.Add("style", "color:Green")
End If
ddl.Items.Add(lst)
End While
ddl.DataBind()
Catch ex As Exception
Throw New Exception(ex.Message)
Finally
cnn.Close()
End Try
The miracle is this--the more we share, the more we have.
|
|
|
|
|
Why dont you apply the style again...
Use
if(IsPostBack)
ddl.Style.Add(HtmlTextWriterStyle.Color,"red")
|
|
|
|
|
I applid color based on the flag if the flag value in database =0 then the item color will red and if flag value is 1 then item color will green?...
The miracle is this--the more we share, the more we have.
|
|
|
|