|
Please don't duplicate posts. If the second post was accidental, please remove it (but only if there are no responses) otherwise remove the first post (again, only if there are no responses). If it wasn't accidental, you need to realize that the people here answer questions on a volunteer basis and will probably not respond in a timeframe you desire or find acceptable.
|
|
|
|
|
hello sir,
i am new in .net. i had made a window application in c#.net
as front end and sql-sever as back end.
now the problem is that how to install sql-server ,.netframework,and execute sql-script and my project on client computer step by step. plz give me details .
your shuaib
|
|
|
|
|
I doubt you're going to get a step by step runthrough. This is quite a length topic, and there are several good articles on this. Try searching on google for details on .net setup with sql server.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I write a C++ program which does the installation of the framework, etc, then I'd build into my app or write a seperate app that runs the scrpts to create the DB.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have created an add-in to Visual Studio 2005, and I would like to use a WCF service.
This requires a configurationfile with the configured endpoints. Normally I would create an app.config, and let visual studio build it to [appname].config in the output directory and it would work.
But when I try to access the services from the add-in, i get a configuration error that the endpoints are not configured. How do i make it open the configuration for the add-in, and not for Visual Studio?
With kind regards
Soren Bendtsen
|
|
|
|
|
If I'm in the wrong place or this is a stupid question I apologise in advance.
I am having to write a data acquisition program in .NET (C#) before I’ve had time to learn it which is making for some interesting code. What I would really like to do is reference a group of 24 progress bar components within a for/next loop using the index of the loop. Does anyone know how to do this? The code I use at the moment is very inelegant and bugs me. Would appreciate any pointers (sorry ‘bout pun)
Ted Edwards
|
|
|
|
|
Wow Ted, that just sounds horrible. But given your situation:
sysrev wrote: before I’ve had time to learn it
and
sysrev wrote: a group of 24 progress bar components
With that situation I would go with "if it works, I don't care".
|
|
|
|
|
But I'll need to do it again somewhere - and again, and again.........
Ted Edwards
|
|
|
|
|
Hi,
hard to give a good answer without knowing your exact situation. You could add all progress bars to a List<progressbar>. After you have done this once you can iterate the list with for/foreach or whatever technique you like.
Robert
|
|
|
|
|
Thanks for the suggestion Robert.
The progress bars display the output of a pressure sensor over a 24 hour period. When I get a new reading, I shift values chronologically "down" one bar and put the new value in the "top" (most recent) bar. The coding begs for an iterative loop but I don't know how to address the bars name property with the index. So I ended up using a switch construct which works okay but is awkward to maintain.
The List class is new to me and on your suggestion I had a quick look at it. I must say, it does not look promising but will try it out if I can.
Ted
|
|
|
|
|
Hi,
I'll try to outline what I meant:
private List<ProgressBar> _bars;
_bars = new List<ProgressBar>(new ProgressBar[] { pb1, pb2, pb3, ... });
for (int i = 0; i < 24; i++)
{
_bars[i] = someArrayWithTheValues[i];
}
With the mod operator you could also easily switch which hour should be displayed at the top:
int hourToDisplayAtTop = 4;
for (int i = 0; i < 24; i++)
{
_bars[i] = someArrayWithTheValues[(i + hourToDisplayAtTop) % 24];
}
Robert
|
|
|
|
|
I think I can see what you are suggesting and am trying to experiment with it in a new application as here:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace IndexComponents
{
public partial class Form1 : Form
{
private ProgressBar pb1;
private ProgressBar pb2;
private ProgressBar pb3;
private List<ProgressBar> _bars;
public Form1()
{
InitializeComponent();
int[] someArrayWithTheValues = new int[3] { 1, 2, 3 };
//Field declaration in the Form/UserCotrol
/// private List _bars;
//somewhere after the InitializeComponents call
/// _bars = new List(new ProgressBar[] { pb1, pb2, pb3 });//when you want to update the bars
_bars = new List<ProgressBar>(new ProgressBar[] { pb1, pb2, pb3 });//when you want to update the bars
for (int i = 0; i < 3; i++)
{
_bars[i] = someArrayWithTheValues[i];
}
//With the mod operator you could also easily switch which hour should be displayed at the top:
int hourToDisplayAtTop = 2;
for (int i = 0; i < 3; i++)
{
_bars[i] = someArrayWithTheValues[(i + hourToDisplayAtTop) % 24];
}
}
}
}
I am now working on the last two(I hope!) build error which are flagged within the two for loops as below:
Error 1 Cannot convert type 'int' to 'System.Windows.Forms.ProgressBar'
Error 2 Cannot implicitly convert type 'int' to 'System.Windows.Forms.ProgressBar'
Ted Edwards
|
|
|
|
|
Replace _bars[i] = ... with _bars[i].Value = ...
(Sorry, my mistake)
Robert
|
|
|
|
|
That's great. It all works - I can experiment further now I have a working example.
Thanks for your help.
Ted
|
|
|
|
|
PC Administrator, using my application, needs to select a folder in which any standard user could read and write. My application needs to verify for any selected folder whether a standard user can read-write into it. How do i do that?
Note that the folder is being set up by Administrator, so checking current read-write access is no good.
Free C++ libraries with source code on www.neatcpp.com: TWAIN, DirectShow, Interprocess Communications, etc...
|
|
|
|
|
|
You could impersonate a standard user and then attempt to read from/write to that folder, if they both work then you have the correct permissions.
|
|
|
|
|
I want to auto login a website(for example,gmail) from winform client.The realization is as follow.
SHDocVw.InternetExplorer IE = new InternetExplorer();
IE.Visible = true;
string URL = "http://www.gmail.com";
object nullArg = null;
IE.Navigate(URL, ref nullArg, ref nullArg, ref nullArg, ref nullArg);
Thread.Sleep(5000);
mshtml.IHTMLDocument2 DOM = (mshtml.IHTMLDocument2)IE.Document;
mshtml.IHTMLInputTextElement textBoxUserName = (mshtml.IHTMLInputTextElement)DOM.all.item("Email", null);
textBoxUserName.value = "****";
mshtml.IHTMLInputTextElement textBoxPassword = (mshtml.IHTMLInputTextElement)DOM.all.item("Passwd", null);
textBoxPassword.value = "****";
Thread.Sleep(3000);
mshtml.HTMLInputElement img = (mshtml.HTMLInputElement)DOM.all.item("signIn", 0);
img.click();
Thread.Sleep(5000);
I code it in vs .net 2005.It works on my machine.But it fails on the machine that only installs .NET 2.0 Framework.The error information is as follow:
System.InvalidCastException Message: Unable to cast COM object of type 'System.__ComObject' to
class type 'mshtml.HTMLDocumentClass'. COM components that enter the
CLR and do not support IProvideClassInfo or that do not have any
interop assembly registered will be wrapped in the __ComObject type.
Instances of this type cannot be cast to any other class; however they
can be cast to interfaces as long as the underlying COM component
supports QueryInterface calls for the IID of the interface.
How can I solve this problem?
|
|
|
|
|
|
Is there any way to get the Line Number of an Exception at runtime. I don't want to use the pdb Files in the release version. I also tried the Stackframe Object and it also doesn't work.
I know that the Project is in the IL when it is build. But perhaps there is a way with reflection?
Any Ideas? Please help me.
|
|
|
|
|
Michael Sterk wrote: Is there any way to get the Line Number of an Exception at runtime.
Yes, pdb files...
Michael Sterk wrote: I don't want to use the pdb Files in the release version.
Why?
Michael Sterk wrote: I know that the Project is in the IL when it is build. But perhaps there is a way with reflection?
No, there isn't. Line numbers, variable names, source file names - all gone. That is what pdb file is - mapping IL instruction adresses to source file lines.
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
Aren't there any security issues when using pdb files?
And what is with ASP.NET Web Applications? Where do i get the pdb file for this? In the "Temporary ASP.NET Files" folder ?
|
|
|
|
|
Yes, there is a security problem. With a pdb file your application can be decompiled and used by a 5 year old scrip kiddie. Without the pdb file only script kiddies over the age of 7 can do it.
The PDB files should generally be found in the same folder as the DLL files - so the "bin" folder of your website.
|
|
|
|
|
Hi
I have a window service which is suppose to read a text file the text file is in a directory called templates. but when i install the window service the service is unable to read the text file and an error is thrown. In the set up of the window service i have included the text files in the template folder.
What could be the problem, Please help
Regards
|
|
|
|
|
Are you using relative paths?
Visit my blog at http://dotnetforeveryone.blogspot.com/
|
|
|
|