|
Yes, I thought that also... but surprise surprise... damned M$ pulled a fast one...
But I can't accept that there is no other way to do this in .NET?
Which means that AppDomain is actually quite useless if this does not work... I don't see the point of AppDomains if you can't create a plugin system... this is very confusing...
Any other ideas?
See the world in a grain of sand...
|
|
|
|
|
DataGridView's SelectionChanged Event Fire earlier than CellDoubleClick Event.
But I hope SelectionChanged after CellDoubleClick.
My Program require:
1> DoubleClick any part of the row, this row selected=true.
read a value from this row as parameter order to open a dialog for do something.
2> When SelectionChanged, another controls's value will changed from the new selected row.
But if DoubleClick fired that another controls's value need not change.
How to do?
Thanks.
|
|
|
|
|
WinForm Controls often fire more events than you would expect.
Maybe SelectionChanged fires more than once, say first to indicate a possible previous selection is no longer selected, then to tell you something new is selected. And some other events may be present in between.
Suggestion: Add some logging to your event handlers to see what happens in sufficient detail.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Maybe not use DoubleClick and SelectionChanged?
Use MouseDown, instead, and test for how many clicks?
if (e.Button == MouseButtons.Left)
{
if (e.Clicks == 1)
{
DoSelectionstuff();
}
else if (e.Clicks == 2)
{
DoDoubleclickStuff();
}
Might not work... But you can set a flag in the MouseDown event indicating whether it was a 1 or a 2 click, then process your SelectionChange code appropriately.
|
|
|
|
|
|
Really? Not in my app. I had to use it to prevent row selection on doubleclicks. Hmm.
|
|
|
|
|
I try to again. not always 1, but first click still call DoSelectionSuff()
Then call DoDoubleClickSuff()
|
|
|
|
|
Ah... Try moving the code currently in the OndoubleClick into a separate function (use the Refactor tool to create the function), then "disconnect" the event from the grid. Call the separate function from the MouseDown event when 2 clicks are seen.
If it doesn't work, just reconnect the DoubleClick. No harm done.
|
|
|
|
|
Hi guys, can some one please help me, m trying to upload files using ajaxupload.js and save to database via the handler file in c#, pls any one help..
|
|
|
|
|
Why don't you read the instructions that come with ajaxupload.js, whatever that is?
|
|
|
|
|
The instruction doesnt tell me how to use in handler file, but it only save it to the local disk. thanks for replying
|
|
|
|
|
|
Prananta_Price, i understand that it is saving to the server, but after clicking the browse button i want to be able to click on save or upload button that will access the uploaded file like in your normal asp file uploader.
|
|
|
|
|
Hello experts,
I would like to ask again if how will I'm going to edit my web services because it seems that it's only working on my local machine.
I tried to upload my web service and the 2 database(ms access 2003 and sql server 2005 express) to a free asp.net hosting site but I got and error that I cant access the database. I detach my sql server 2005 express to my sqlSERVER Management studio before I upload it.
Below is my sample code to my asmx file.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
using System.Data;
using System.Data.OleDb;
namespace WebService1
{
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public DataTable getData()
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\MemberSites\\MemberSites_AspSpider_Info\\akosiDAN\\database\\Database1.mdb");
DataSet ds = new DataSet();
DataTable dt = new DataTable();
ds.Tables.Add(dt);
OleDbDataAdapter da = new OleDbDataAdapter ("Select * from phonebooktable",con);
da.Fill (dt);
return dt;
}
[WebMethod]
public DataTable getData()
{
SqlConnection con = new SqlConnection("server= DANDAN-PC\\SQLEXPRESS;uid=MYID;pwd=MYPASSWORD;database=phonebookdatabase");
DataSet ds = new DataSet();
DataTable dt = new DataTable();
ds.Tables.Add(dt);
SqlDataAdapter da = new SqlDataAdapter("Select * from phonebooktable", con);
da.Fill(dt);
return dt;
}
}
}
Any help are kindly appreciated.
Thanks,
DAN
|
|
|
|
|
My first idea: I see you have connection strings hardcoded into your source code. Are you changing them before uploading to match configuration from the hosting server? If not, it can't work, because (most likely) your service cannot find server DANDAN-PC, nor file "C:\\MemberSites\\MemberSites_AspSpider_Info\\akosiDAN\\database\\Database1.mdb".
You should move both those connection strings to the web.config file.
Don't forget to rate answer, that helped you. It will allow other people find their answers faster.
|
|
|
|
|
Hello,
Thanks for the reply,I tried changing my connection strings now provided in my web hosting site. The connection strings given by my host is in this link
http://www.aspspider.com/tips/Tip18.aspx[^]
I'm not that so much sure but doesn't the ms access database supposed to work since I followed it. I tried commenting the one using sql server connection string just to test the ms access 2003 and I even tried to re add my web reference to be sure but still I got an error.
To give clarification my error is in below
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
I'm also confuse since why does my error state that I have error in sql but I'm using oledb since my database is ms access 2003 and I already comment the block of code using sql.
Any help are kindly appreciated.
Thanks,
DAN
|
|
|
|
|
Indeed. Both connection strings are absolute paths to things that are on the local machine, and almost certainly won't be in the same place when hosted. Make sure the connection strings in the uploaded version point to where the database actually is (your host should be able to tell you this).
And indeed, connection strings should be in a configuration file, so your code base can be the same for testing and deployment.
|
|
|
|
|
Hello,
I fix now the problem it seems that one causing the error is the bin file of my webservice. I notice that although I edit the code of my asmx file and even if its a working code but if I did not re upload the the bin file of my webservice.The website still load the past code of my asmx rather than the new one.
Thanks everyone,
DAN
|
|
|
|
|
This code shouldn't even compile. You've got the exact same method (getData) defined twice, with no difference between the two method headers. There has to be some way to deifferentiate the two either by name or by the parameter list.
|
|
|
|
|
Hello,
Sorry for the confusing part. I was trying to test only if how it work by commenting other or vice versa in that time thats why I have the two methods. Thanks for the reply.
Any help are kindly appreciated.
Thanks,
DAN
|
|
|
|
|
Hello,
I fix now the problem it seems that one causing the error is the bin file of my webservice. I notice that although I edit the code of my asmx file and even if its a working but if I did not re upload the the bin file of my webservice.The website still load the past code of my asmx rather than the new one.
Thanks everyone,
DAN
|
|
|
|
|
Have a look on the connection string of the MDB file. or use Server.Mappath to get actual path of the mdb file.
|
|
|
|
|
Hello,
I fix now the problem it seems that one causing the error is the bin file of my webservice. I notice that although I edit the code of my asmx file and even if its a working but if I did not re upload the the bin file of my webservice.The website still load the past code of my asmx rather than the new one. Thanks also for the server.mappath if was a great help to map the path of my files.
Thanks everyone,
DAN
|
|
|
|
|
Hi,
On my local machine, I have developed a c# application which reads from a sql server express database.
Now I want to install these (The application and the sql server express) on the client machine.
On the client machine, with the login I have, I can only have access to the U drive.
Questions:
1- Can I install the appplication on the U drive or does it have to be the C drive?
2- I also have to install the sql server express on the client machine. Can It be installed in the U drive?
3- The application has a config file which is used to access the sql server i.e. ./sqlexpress, etc...
What should the config file path be if both the application and the sql server express are installed in the U drive?
Thank you
|
|
|
|
|
You can install the application where ever you would like, however, there may be components, especially with SQL Express that will require administrator rights.
The connection string for SQL Express would be .\SQLExpress, where the dot is shorthand for local.
I know the language. I've read a book. - _Madmatt
|
|
|
|