|
Thank you. I know that the problem is with OldeDb. Like I've mentioned before it doesn't retreive values from Excel, they are just empty. In my research I found out that when you use OldeDb to extract data from Excel it uses first column's format, which is text in my example. I just thought there's a way around it.
Thank you again. If you hear anything let me know. And if I find something out I'll pst it here.
Alex.
|
|
|
|
|
OK. I figured it out with the help of a samrt man of course.
Here's the code and it will work. I hope that I can save some time to others if they need to do the same thing I do now.
Enjoy.
Try<br />
'Create DataSet and DataAdapter<br />
ds = New System.Data.DataSet<br />
da = New System.Data.OleDb.OleDbDataAdapter<br />
<br />
con = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Session("ExcelFilePath").ToString() & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;MaxScanRows=0""")<br />
<br />
'Create command<br />
cmdSelectExcel = New System.Data.OleDb.OleDbCommand("SELECT c.[Company], c.[Journal Entry], c.[Vendor] FROM [Sheet1$] AS c ORDER BY c.[Company]", con)<br />
<br />
'Open connection<br />
con.Open()<br />
<br />
'Exectue command through adapter<br />
da.SelectCommand = cmdSelectExcel<br />
da.Fill(ds, "Company")<br />
<br />
'Assign DataSourse of the DataGrid and bind it<br />
dg.DataSource = ds.Tables(0).DefaultView<br />
dg.DataBind()<br />
<br />
'Close Connection<br />
con.Close()<br />
Catch ex As Exception<br />
'Display error message<br />
lblError.Text = "Error: " & ex.ToString()<br />
lblError.Visible = True<br />
End Try
|
|
|
|
|
I'm trying to find a definitive answer to this question:
How many users are allowed to view web reports on Crystal Reports 11 developer edition?
I keep getting different answers. Business Objects told me there was no limit however I keep reading online that there is in fact a limit.
I'm developing a website for our client that needs to generate PDF/excel reports for each of their sales reps(meaning each of their 1100 sales reps needs to have the ability to go onto the website and view their report).
The website will be located on one of our company servers but obviously, outside of our firewall.
Can I use crystal for this task of handling 1100 sales reps or is there a limit to the number of users who can use this? If not, can anyone recomend a better alternative?
Thanks.
-Goalie35
|
|
|
|
|
Hi May be this is not the appropriate place but still believe it will yield something. Pls guide me to a starting link for web promotion on search engine and marketing the web site for generating revenue.
Many thanks
Don't Quit
|
|
|
|
|
web promotion is very - very good and easy work for web site promotion if you want to gruid properly read on google search engine.Its make easy for you.
Pavan Pareta
|
|
|
|
|
Hi all,
can any one tell me the difference b/w DataGrid & Gridview webserver controls?
is there any site which explains me about .NET 2.0 server controls other than Microsoft.com?
Thanks,
Rahi Sharma
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
The GridView replaces the DataGrid in ASP.Net 2.0. I'm guessing they changed the name because of the great deal or new funcionality built in to it since version 1.1. EG Sorting
|
|
|
|
|
I just had my most embarasing moment when I realised that I cant link to a website from an event handler.
Can you show me the code to transfer to(maybe codeproject.com) from an eventhandler using VB.net in an ASP.NET page
Soon to be famous black south african programmer
|
|
|
|
|
Response.Redirect("http://www.codeproject.com")
|
|
|
|
|
Hi there.......
I used validation controls in my aspx applicaion, in local machine it's working fine. If i uploaded in remote server, it is showing error..
If i use this,
means, in remote server validation controls are working fine, but button click event was not generated.........
Please help me.....
Thks n Advance
Sam.M
|
|
|
|
|
pls provide full path of our javascript file like
Keep Smiling !!! Tomorrow Never Die
Parwej Ahamad
g_parwez@rediffmail.com
|
|
|
|
|
Hi,
I am not able to take the setup of my web application.I have right clicked on the solution and added new project. selected the primary output,content files etc.
Every thing is getting compiled when I rebuild the solution but the content files are not getting added.
I could only see the bin directory.
Please help..
Regards,
Sivaprasad
|
|
|
|
|
Hi,
Can anyone suggest a free to use web service for a test bed application?
Something like a weather forecast service..
Any thought?
Kevin
|
|
|
|
|
how can i create a proxy of ma web service
bia
|
|
|
|
|
|
Hi All,
We can use server.execute() to execute child webpages and get the response.
Suppose that we have a page on http://www.abc.com/default.asp;
Now How can I execute the url and get the whole response including javascript executions.
I need to do using ASP.NET ,C#
Please help me to solve the problem.
Thanks in advance.
|
|
|
|
|
you can open the url using httpwebRequest and httpwebResponse but it will not run javascript for that you have load html page in the memory so that it allow the javascript to run .
Reply What you have to do (read data coming from java script function ?)
|
|
|
|
|
Hi,
Yes I have used HttpwebRequest class for my work.But Javascript functions are not executing.
Suppose that in the the Response Page In side the Tag following javascript consists:-
How can get complete response page with executing Javascripts?
Please kindly help me.
Thanks in advance.
|
|
|
|
|
You can do that by getting whole HTML page into memory
Use microsoft.mshtml.dll and AxSHDocVw.dll
string URL="http://www.Google.co.in";
object oMissing = null;
HTMLDocumentClass objects=new HTMLDocumentClass();
axWebBrowser1.Navigate(URL,ref oMissing,ref oMissing,ref oMissing,ref oMissing);
while(axWebBrowser1.Busy)
{
Application.DoEvents();
}
objects=(HTMLDocumentClass)axWebBrowser1.Document;
If you are using Windows application then it works fine but don't know for web application
Best of luck
Sandeep
|
|
|
|
|
Hi,
I am populating a regular datagrid with field data. One of those fields shows a "Severity" rating. There are 3 "Severity" ratings:
1 - Red
2 - Amber
3 - Green
Instead of displaying "Red ", "Amber " or "Green " in the column of the datagrid, I would like to display a different image for each. ie. Green Circle for "Green ", Orange Circle for "Amber " and a Red Circle for "Red ".
I was informed that I have to use the ItemDataBound Event for this, but I don't know how. Please Help!
Thank you.
|
|
|
|
|
Yes that is correct you can use OnItemDataBound event. This event gets fired for each row of the datagrid and there in that event you can check what you need to display(depending upon your condition).
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi,
Thank you for the reply! =D
I am going to look further into the EVENT. If you can give me any more hints/examples, that would be great, as I have never used this EVENT before.
|
|
|
|
|
To use that event what you need to do is first the place where you are declaring the datagrid(HTML view) you have to mention this inside the datagrid tag
OnItemDataBound="dg_itembound"
and in your cs file you have to define that one like this:
public void dg_itembound(object sender, DataGridItemEventArgs e)
and here inside that you can do whatever you want.
BTW for more details you can have a look at this.[^] Here you can get so many examples.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Thanks Apurva, I have been ill for the past few days and havent had a chance to try this out. I will get back to it soon and give you a reply! =]
|
|
|
|
|
Hi,
In my application i have to provide facility to user to download data in excel format and then again upload that file after editing it so that changes in database can be done accordingly.
I have accomplish it but in the file i have to also gave option to user to upload image for each row i try it by giving the path of image but its not working.
Is their any way to access file from client end other than FileUpload
control as i already use it for uploading excel file?
Thanks in Advance.
|
|
|
|