|
I have created a db in SQL server with C# code (local).
I want to use this db on another computer, at local level.
It generates an error. I think the problem resides on the username and password.
¿Could anyone explain me (with c# code) how can I use this db in different local computers?
Saludos, Giovanni
|
|
|
|
|
Simply modify the connection string to point to the remote computer's name (or IPAddress), instead of (local). For example, if your connection string is now
"Persist Security Info=True;Integrated Security=false;Initial Catalog=Database;User ID=sa;Pwd=;Data Source=(local);" just change it to
"Persist Security Info=True;Integrated Security=false;Initial Catalog=Database;User ID=sa;Pwd=;Data Source=YourRemoteMachineName;"
|
|
|
|
|
Something that I have to say is: Both computers are not connected via network.
Then, the database is transported manually to another computer. I tried to access de data of that database, but it generates an error ("ERROR: Cannot open database "estebansho" requested by the login. The login failed. Login failed for user 'GIOMOVIL\Giovanni'.")
GIOMOVIL is the name of the equipment where I tried to open the db.
Giovanni is the username of the equipment where I tried to open the db.
PLEASE, HELP ME.
Saludos, Giovanni
|
|
|
|
|
|
Hi,
I have a dialog box that has a AxWebBrowser in it. I need to synchronize an edit in my dialog with a specific edit in the web page that I display (when the user type ssomething in the web page I need the dialog edit box to show the text as well).
IHTMLDocument2 has a bunch of methods that look like they would help (onkeydown, onkeyup etc) but I can't figure out how to hook them up with my dialog edit box.
Does anybody have any suggestions?
thanx
|
|
|
|
|
Hi,
If several items in one ListBox1 are selected and would like to be moved to listBox2 then how is this done please?
Obviously these items should be removed from listBox1
Somethink like:
for each(item in listBox1.row)
listbox2.items.add(item)
Could you correct this please?
Thank
|
|
|
|
|
foreach(object item in listBox1.SelectedItems)
listBox2.Items.Add(item)
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
You could also do;
ListItemCollection LIC = new ListItemCollection();
LIC = ddl1.Items;
foreach(ListItem listitem in LIC)
{
ddl2.Items.Add(listitem);
}
|
|
|
|
|
Hi.
let's say i have the following code:
int x;<br />
...
if ((x == 1) || (x == 5) || (x == 7) || (x == 9))<br />
{<br />
... /some code<br />
}<br />
is there an elegant way to code it without repeating the x object? i thought about something like:
if (x == (1 || 5 || 7 || 9))
Thanks
|
|
|
|
|
not really, other than
switch(x)<br />
{<br />
case 1:<br />
case 3:<br />
case 5:<br />
case 7:<br />
break;<br />
}
but this is more longwinded than the aforementioned if (x==1 || x==3 || x==5 || x==7) method
|
|
|
|
|
Hi,
another possibility:
if (Array.IndexOf(new int[] { 1, 5, 7, 9 }, x) >= 0) {
}
If you store the array in some field it would be shorter (and more efficient when called often):
private int[] _goodNumbers = new int[] { 1, 5, 7, 9 };
if (Array.IndexOf(_goodNumbers, x) >= 0) {
}
Robert
|
|
|
|
|
Hi, there
I've created a window application consisting of one form, one user control, and 3 classes.
After building it, I tried running the exe file directly and it worked fine.
However, when I closed my application, the application form was closed correctly but it still stayed in the process list (seen from the window task manager).
When I tried running it again, another process of the same name appeared in the process list.
Running it multiple times brought up multiple processes.
I believe that's because the application is not really terminated.
I also made sure that all instances of the classes are disposed by inheriting them from IDisposable and calling GC.SuppressFinalize(this) in the Dispose() method.
Anyone got any idea about this?
Please help me fix it or my application will eat up all the user's resources. T-T
Thank you very much.
KiT
|
|
|
|
|
which IDE are you using? vc# 2005 express does start a ApplicationName.vhost.exe when opening the solution and restarts the process if you kill it manually - try to kill it manually and check if it is started again :P
|
|
|
|
|
I'm using VS2005 and it does start AppName.vhost.exe.
Killing each process can really terminate the app.
However, that's what I need to solve: not to have to end it manually.
Thank you very much.
KiT
|
|
|
|
|
Hi,
The reason you're probably having this is because you're calling GC.SuppressFinalize(this).
From msdn:
GC.SuppressFinalize Method
Objects that implement the IDisposable interface can call this method from the IDisposable.Dispose method to prevent the garbage collector from calling Object.Finalize on an object that does not require it.
I'd advice against implementing IDisposable if you aren't using unmanaged resources or threads anyway, the garbage collection usually handles itself quite well anyway. Good luck!
|
|
|
|
|
I've tried removing all the implementation of IDisposable.
However, it doesn't solve the problem.
Thank you very much.
KiT
|
|
|
|
|
Are you creating any threads by yourself? If true, you need to set the IsBackground[^] property of those threads to <code>true</code>. Otherwise, those threads will remain alive and will prevent your process from dying.
|
|
|
|
|
did you tried application.end
this usually happens when you call some form from another form and just hide the base form
or some thread in back ground is still working
it will be a better option to debug your application
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
I have only one form and not calling any other forms.
But I do calling some classes and a user control.
Where to set Application.end?
Thank you very much.
KiT
|
|
|
|
|
at formclosing event or where ever you want to close your app
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
I've run into similiar circumstances. I have the forms running on seperate threads and I also have a thread running a formless message loop. When the form closed, the application didn't shutdown because the other thread was still running. Try calling Application.Exit() when the form closes. It's probably not that simple, but I'd thought I'd pass on my 2-cents worth.
|
|
|
|
|
|
|
Hi Senthil,
I have the same problem, but the ScrollToCare method you have suggested has no effect (or not what I hoped to do)
This code snippet should place the cursor always at the current position
but it does not scroll to the end of the lines.
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
this.richTextBox1.Clear();<br />
for(int i=0; i<200; i++)<br />
{<br />
this.richTextBox1.SelectedText = "Index = " + i.ToString() + "\r\n";
this.richTextBox1.ScrollToCaret();<br />
}<br />
}<br />
catch{}<br />
}<br />
What's wrong ?
Tnx in advance
Regards
Frank
|
|
|
|
|
Does anyone have a particle filter for tracking objects in avi, mpeg files?
|
|
|
|