|
Hi All,
Thanks all . I have solved this problem
using following way
MySqlConnection con = new MySqlConnection(("server=127.0.0.1; user id=root; password=password; database=testwithdotnet; pooling=false;"));
Thanks and regards,
Amit Patel
modified on Tuesday, November 10, 2009 2:57 AM
|
|
|
|
|
Well, that's what we both told you to do, so....
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
|
Use the connector[^] provided by MySql folks.
Best wishes,
Navaneeth
|
|
|
|
|
hi ,
i m using this
string ConnStr = "Driver={MySQL ODBC 6.1.2 Driver};Server=localhost;Database=testwithdotnet;uid=root;pwd=password;Port=3306;Option=3";
OdbcConnection odbcConnection = new OdbcConnection(ConnStr);
OdbcCommand cmd = new OdbcCommand("SELECT * FROM amit", odbcConnection);
odbcConnection.Open();
but this is giving following error.
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
thanks and regards,
amit patel
|
|
|
|
|
Amit Patel1985 wrote: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
What makes you think this error is wrong ? What leads you to believe that the connection string is pointing to a valid driver ? Have you installed/configured one for ODBC ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi,
In my ASP.NET application, I have a situation where I am doing a lot of computing and database reads/inserts/updates.
I needed to gather statistics on the processing records. This info is actually displayed on another webpage. Processing routine looks something like this:
public void Process()
{
int recordCount = 0;
ProgressHelper.Start();
while(processing)
{
recordCount++;
if(recordCount % 10 == 0)
{
ProgressHelper.UpdateProcessedRecordCount(recordCount);
}
}
ProgressHelper.End();
}
These database calls to update the progress add additional delay.
I was wondering if there is a way to actually execute all the ProgressHelper stuff asynchronously (without using background worker)? (perhaps delegates ... but are delegates really async?)
|
|
|
|
|
What is ProgressHelper ?
BackgroundWorker is a class designed for windows applications not web applications. So using it in a web application is not a good idea. If I understood your question, you need to do a time consuming task on background and show a progress bar on another ASP.NET page, correct?
If yes, follow the below steps.- From the first page, start a thread (or better if you can use
ThreadPool ) and run the Process() method on that. - This method should update the progress to a session variable say
Session["progress"] - Once the thread started, redirect to the page where progress will be displayed
- Use AJAX and poll the
Session["progress"] value and show it on the page. For creating progress bar, you can use HTML DIV tag with a background color. You need to pass HttpContext.Current to the Process() method because it is thread specific and a worker thread won't have access to it. Use this context to access the session.
Hope that helps
Best wishes,
Navaneeth
|
|
|
|
|
Thanks Navaneeth. ProgressHelper is my internal DAL responsible for udpating the progress table (sorry I should have explained). I agree with you that BackgroundWorker is a bad idea that's why I was wondering if there might be a better way to accomplish this.
Also, what are your thoughts about Async Delegates? Have you seen any adverse effects of using them in ASP.NET?
Appreciate your hlep!
|
|
|
|
|
student_rhr wrote: I agree with you that BackgroundWorker is a bad idea that's why I was wondering if there might be a better way to accomplish this.
See the point 1 in my first reply.
student_rhr wrote: Also, what are your thoughts about Async Delegates? Have you seen any adverse effects of using them in ASP.NET?
Asynchronous pattern will make your code unnecessarily complicated. So I'd stay away from it unless there is a strong need for using it. As I said, work with Thread or ThreadPool directly.
Best wishes,
Navaneeth
|
|
|
|
|
Hi,
I need to develope web site which connect to the pop3 mail server and populate all emails in a grid.
so after user can select emails from grid and can delete unnecessary mails through grid.
i have search lot of samples most of them are windows based.does any body know or can direct me to correct path.
i'm using .net 3.5 with sql server 2008.
thankx
|
|
|
|
|
It makes no difference. your web page, on postback, can use the same code to check mail and populate the page with the results.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
can any u provide few examples...
|
|
|
|
|
You said you found lots of them on the web, so why would you need more ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You can connect to a pop3 server using a TCP connection. Once the connection established, there are a set of commands to communicate with pop3 server. There is an RFC[^] for these commands.
|
|
|
|
|
Hi All,
How to maintain "session" state or the like for a show/hide menu when I click a sub link from an open block of sub category, like the one The Code Project did it on the left menu panel.
For example, if I click on "Web Development" link under "ARTICLES" category, it will show many links under the "Web Development" block. Click on a link in that open block, the page will refresh and show me article I wish to view. The problem I have is I can't figure out how to maintain session of the link I just clicked. That is keep the block "Web Development" open after the page refreshes.
Thank you.
|
|
|
|
|
What is the problem with that. Use hiddenfield to get it.
Or rather you could get the group where the user clicked from its url as well...
|
|
|
|
|
Hi
I have en Asp file lcon.asp in my website project, where I use an Iframe. I want to be able to use the iframe in the code behind from another aspx page.
<iframe runat =server id="left" src="ShowGroups.aspx" scrolling="no" frameborder="0" width="100%" height="1000"></iframe>
I would like to do something like this.
protected System.Web.UI.HtmlControls.HtmlGenericControl frame1;
HtmlControl frame1 = (HtmlControl)this.FindControl("left");
frame1.Attributes["src"] = "http://search.msn.com";
But if there is another way to refresh the iframe, please tell me.
Fia
|
|
|
|
|
I don't want to use javascript.
|
|
|
|
|
AFAIK ... no wayout other than javascript. At least the page should be posted back to the aspx page to get the iframe.
You need to use custom handler to do this as your actual page is asp.
Why dont you convert the asp page to aspx then.
|
|
|
|
|
Thank's for your answer, but I can't convert or not allowed to convert tha asp page to aspx. What do you mean by post back to the aspx page. And what is custom handler.
Fia
|
|
|
|
|
I mean say you have a page called submitRequest.aspx
Now from your Asp page use:
<br />
<form action ="submitRequest.aspx" >
thus when the page is posted back it goes to submitRequest.aspx . You can get each of those form elements using Request object from submitRequest.aspx (even the IFrame ) where page is your custom handler.
You can also use a class which inherits from IHttpHandler to call its process request.
On the other hand, how could you access the iframe from the server side, if your actual parent page is made using asp. You better use javascript to get reference from Iframe if you do require.
I hope you got my point.
|
|
|
|
|
Hi again
I'm grateful for your answers, but I'm rather new to asp.net. How should I write to get a hold of the iframe. The iframe have id="left" in the asp page. But when I try Request["left"], I get null. And how am I going to change the src of the iframe.
Hope you have time to help me more
Fia
|
|
|
|
|
I think you need to use Javascript to communicate between the two pages, one the page that is loaded in iFrame and another is what is written in asp.
If you can submit the asp page in a handler custom handler and access Request.Params to get the controls.
|
|
|
|
|
Hi again
Do you have any code so I can see what I have to do. I don't know how to submit a page and I don't know how to use a custom handler. I have googled, but havent found anything I can use.
Regards
Fia
|
|
|
|