|
ejohns85,
Just a thought, but you could include the avi in your deployment package (eg: installer)
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I'm creating .NET 3.5 WinForms application.
I need to create textbox which remembers last 10 entries (stores in isolated storage) and
offers users to select them on entry just like IE auto-complete address bar.
I think I must use textBox custom AutoCompleteSource.
Any idea or sample how to implement this ?
Andrus
|
|
|
|
|
AndrusM wrote: Any idea or sample how to implement this ?
Search for the articles here on CodeProject, there should be many.
|
|
|
|
|
Thank you.
I made some search but havent found any.
Can you point me to some articles, please.
I need to run this under MONO also, so best is wihtout direct winapi calls.
Andrus
|
|
|
|
|
AndrusM wrote: I made some search but havent found any.
Try harder
|
|
|
|
|
Hi.
I am developing a pocket pc application using c# and VS 2008. I have a web service with some methods to make CRUD
operations and connect the pocket pc application to SQL Server 2005. So far so good.
I need to send the information to connect to the database server from the pocket pc to the web service, you know, the
server name, user id, password and database name. At this point i have a problem. I don't know how to pass that info
from PPC to the web service or i don't know what is the correct way to achieve this.
I have tried this:
public class MyService{
public MyService(string server, string uid, string pwd, string database){
}
}
I have added in the constructor method of the web service some parameters to send the connection information from the
pocket pc to the WS.
But the problem is that i can not send information via parameters to the constructor of the class or WS. I mean, i have this
code in my ppc app:
MyService ws = new MyService("server","sa","123","mydata");
This code does not work 'cause it seems that i can not send information, parameters to the constructor of the web service.
So i would like to know what is the correct way to connect an application to the database making use of web services, or
how to send connection information from any app to the web service to connect to sql server.
One way could be sending this info to any method i have in the web service, but i don't like this way, i think it's not
the right way.
Thanks for your time.
Bye...
Henry de Sousa
|
|
|
|
|
HenrydeSousa,
Use properties.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Hi.
Thanks for your answer.
This is what i'll do. I'll create four static properties in a class and store the server name, user id, password and database name
to the properties form the pocket pc app, then when i need to call a method of the web service to communicate with the database i'll
send these properties as parameters to the methods.
I guess this is what you meant, i tried to create a property in the web service and stablish the value to that property
from the pocket pc app but i can not access any property of the web service, if i am wrong please tell me.
Regards...
Henry de Sousa
|
|
|
|
|
Hi all,
I have an application developed with c#.net and it getting a error rarely, saying we are middle of something application needs to be closed. I have used tcp communication, streaming using grabber like that. Application is running nicely, but it is giving that error suddenly. I cant trace the error in my application handling exception. The things is I have also same error message from Internet Explorer even. I cant imaging how that error comes. If you guys know regarding that error please let me know and also can you tell me stop that error. I have attached the error messages.
Error Message :
“If you were in the middle of something, the information you were working on might be lost.”
|
|
|
|
|
Run the application in a debugger and find out why.
|
|
|
|
|
That's not even an error message. It doesn't say anything at all about what it might be that went wrong, or even that something definitely did... It only implies that something may have gone wrong, as there might be some consequences...
Check if you can get hold of a real error message, perhaps in the event log.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Friends,
I dont know in which section should I post this question coz it related to both C# and ASP.NET.
I have very strange requirment.
I our project we developed our application in windows forms project. The project contains a bunch of class libraries and number of windows usercontrol libraries.
Now we are hosting those user controls to the web.
Everything is working fine till the control with FileOpenDialog in it comes in picture.
When that user control opens in web it throws the followin exception.
"Application attempted to perform an operation not allowed by the security policy. To grant this application the required permission contact your system administrator, or use the microsoft .net frameword configuration tool.
Request for permission type 'system.security.permissions.fileiopermission, mscorlib, version=2.0.0.0, Cultrue=neutral, pulickeytoken=xxxsdlff' failed."
I know the reason why this exception is coming.
what I want to know is , is there any work aroud of this problem except using asp.net "file" control?
Thank you all in advance.
Thanks and regards,
Chetan Ranpariya
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Is the web app running under full trust?
|
|
|
|
|
Do you mean that you're using Windows Forms controls in a webpage, where the control is downloaded to the browser?
Those controls run in a security sandbox, to prevent them from damaging the rest of the system (this is the same as Java applets). The CLR enforces this security sandbox by preventing code from being loaded that would violate the security policy.
One of the things that remote code is not allowed to do is open arbitrary files directly using the
FileStream class or its derivatives. You can generally, however, open files via an
OpenFileDialog , if you use the
OpenFile method of the dialog object. You cannot find out the filename using the
FileName property.
The .NET Framework security set is quite granular. The exact permissions to perform a task are generally listed at the bottom of the documentation. You can find the list of defaults at Default Security Policy[^]. Your code, if running in a web page, will come under the Local Intranet zone if on the local network (and, in IE 7.0, the computer is on an Active Directory domain) and under Internet if on a different network.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi all,
I'm working on a university results project and i need to transfer data from an already existing Excel spreadsheet to my sql server database, so that i can readily perform queries on legacy data. I also intend to use the DAAB of the Microsoft Enterprise Library (January 2006)to implement it.
Can anyone help me on how to go about this?
Obinna from Nigeria.
//obinnaaj Eof
|
|
|
|
|
If you are trying to do this by C# code, then I suggest looking at the Microsoft.Office.Interop.Excel namespace
|
|
|
|
|
Hi all,
I am trying to write a function which converts plural words into singular words. Below is the function which i have created but it is not working properly for the words which ends with -se like lease, prise etc. Means when it comes to conver these words from plural to singular it is not giving proper output.It is converting "Leases" to "Leas" and "phrases" to "Phras".
Please help me as soon as possible!
private void _StripPlural(string strValue)
{
if (strValue.Length > 1) {
if (strValue.EndsWith("s")) {
strValue = strValue.Substring(0, strValue.Length - 1);
string strPluralRule="s,z,x,ch,sh,ss";
bool blnFlag = false;
char[] arrchDelimeter ={ ',' };
string[] arrstr = strPluralRule.Split(arrchDelimeter);
for (int i = 0; i < arrstr.Length; i++)
{
string strTest = arrstr[i] + "e";
if (strValue.EndsWith(strTest) && !strValue.EndsWith("sse"))
{
blnFlag=true;
return;
}
}
if (blnFlag == true)
{
strValue = strValue.Substring(0, strValue.Length - 1);
}
if (strValue.EndsWith("ie")) {
strValue = strValue.Substring(0, strValue.Length - 2) + "y";
}
if (strValue.EndsWith("sse")) {
strValue = strValue.Substring(0, strValue.Length - 1);
}
}
}
//return strValue;
}
Regards,
|
|
|
|
|
KBM73 wrote: string[] arrstr = strPluralRule.Split(arrchDelimeter);
That will eat your delimiters, how will you add it again? You will have to think of another way
|
|
|
|
|
leppie wrote: You will have to think
Doesn't the OP pretty much rule that out?
led mike
|
|
|
|
|
|
hey how to create dynamic gridview in default.aspx in page_load event
|
|
|
|
|
1. Add a placeholder on your ASP page (VERY IMPORTANT!).
2. Create a gridview from code, and add it to your placeholder's Control collection.
|
|
|
|
|
Hi,
I want to change a timer when I find that a particular process is running..
Here is my code:
class Program
{
System.Threading.Timer SendDataTimer;
static void Main(string[] args)
{
Program MyObj = new Program();
MyObj.MyMethod();
}
public void MyMethod()
{
TimerCallback tcb_SendData = new TimerCallback(Callback_Method_SendData);
SendDataTimer = new System.Threading.Timer(tcb_SendData, 0, 0, 1000);
Console.Read();
}
void Callback_Method_SendData(System.Object state)
{
Console.WriteLine("Timer Executed at: " + DateTime.Now.ToString());
foreach (Process p in Process.GetProcesses())
{
if(p.ProcessName == "notepad")
{
SendDataTimer.Change(0, 3000);
}
}
}
}
However in this, when I open notepad, the timer continues to run very quickly and when I close it, then it changes the timer..
Why is it so?
I want that the timer should change the timings as soon as notepad opens but does execute very fast when I open notepad and why dosent the time change in the interval when notepad is opened?
Why does it take to close the notepad and then the timer changes..
I hope you get my question.
Thanks.
|
|
|
|
|
ptr2void wrote: I want that the timer should change the timings as soon as notepad opens but does execute very fast when I open notepad and why dosent the time change in the interval when notepad is opened?
Why does it take to close the notepad and then the timer changes..
Let my copy the docs:
"period
The time interval between invocations of the callback method specified when the Timer was constructed, in milliseconds. Specify Infinite to disable periodic signaling.
dueTime
The amount of time to delay before the invoking the callback method specified when the Timer was constructed, in milliseconds. Specify Infinite to prevent the timer from restarting. Specify zero (0) to restart the timer immediately. "
So when you do:
SendDataTimer.Change(0, 3000);
0 implies the callback will be called every 0 ms...
[update] I hate it when the documentation lists the parameters the wrong way around!
0 implies the callback will be called immediately [update]
modified on Wednesday, May 28, 2008 9:45 AM
|
|
|
|
|
Use of System.Threading.Timer requires a lot of thought because the callbacks always occur on the thread pool. This means they almost always fire on a different thread to the one that created the timer, that they can run concurrently if the callback function takes a long time to execute, and conversely can be blocked indefinitely if the thread pool is busy.
It is generally much safer to use a System.Windows.Forms.Timer , as long as you're running a message loop (Application.Run ) on the thread. This causes the callback to be fired on the thread that created the timer when no other message is outstanding after the timer duration has passed. (This class maps directly to the operating system's SetTimer call.)
When you're debugging, you're typically stepping through code much more slowly than once a second, so the timer could well be firing another callback while you're still debugging it. You need to ensure that this isn't what you're seeing.
I can't see a problem with using GetProcesses , except to note that there's also a GetProcessesByName method which could simplify your code a bit. (Internally, this method calls GetProcesses , though, and copies the matches to an ArrayList and then to another array, so it actually produces more garbage.)
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|