|
i want to create shortcut from my application from setup package
how i do that
md_refay
|
|
|
|
|
That varies, depending on what software you're using to create the setup.
Bastard Programmer from Hell
|
|
|
|
|
Do you use Microsoft Visual Studio (which version?) for your setup project? There you could have the setup create the shortcuts: open the editor for the file system, and add a link to desktop, program menu etc.
|
|
|
|
|
Hi,
I'm trying to come up with the architecture for my new project.
It's a window form based application with a SQL Server backend.
I would like to use a multi-tiered approach with the database, a data access layer, a
business logic layer and a user interface layer.
The structure of the solution is as follows
- DAL (Class Library)
- BLL (Class Library)
- UI (Window form application)
From what I understand, the UI should not have access to the DAL (except via the BLL),
so there should be no reference to the DAL in the UI. Wright ?
I use the "TableAdapter Configuration Wizard" to generate my DAL code, which sometimes
returns typed datatables. The businesslogic layer returns those same typed datatables that
were defined in the DAL. I'm setting the data source of a gridview to that typed datatable.
This requires that the UI know something about the datatable defined in the DAL, so to make
this work I have to place a reference to the DAL in my UI layer, which I supose is not
good programming practise. How should this be done ??
|
|
|
|
|
Move the datatables to a new Class Library project and add reference to this library from your DAL and UI projects.
|
|
|
|
|
Having data classes bubble up from the DAL shouldn't be a problem; but, as Shameel said, defining them in a separate place is even better.
paper67 wrote: I use the "TableAdapter Configuration Wizard" to generate my DAL code
I prefer to roll my own and maintain control.
|
|
|
|
|
So when I intend to keep the wizards autogenerated code, referencing the DAL in the UI layer
to access the typed dataset, datatable and datarow types returned from the BLL is not so bad ??
|
|
|
|
|
As long as you access them via the BLL.
|
|
|
|
|
In addition to the other comments I would consider Enity Framework for the entities and DAL. Place the former in a seperate assembly to be references in the other layers.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello,
I have used this method but to return a single int value. Now I am returuing a string.
I have tried to define the local variable as a string as well as object. It just does not seem to be returning a string value.
I have tried the following different ways:
1. string name = sqlcommRights.ExecuteScalar() as string;
2. string name = (string)sqlcommRights.ExecuteScalar();
3. object name = sqlcommRights.ExecuteScalar();
I am printing the SQL statement and running in sql server, that returns a single row value like 'John Smith'.
To check value - Response.Write(name);
Am I missing something here?
|
|
|
|
|
Try;
string name = sqlcommRights.ExecuteScalar().ToString();
Though, Its a good idea to check the result isnt null before trying to access it.
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
I'm surprised 2 & 3 don't work. The thing to do to figure out why they don't:
1. What is the error message you are getting?
2. In version 3, have you put a breakpoint on to see what value you get back - it is a good idea to check this in code even if it works on the SQL side.
|
|
|
|
|
What is the SQL code that you are calling? Is it a stored proc? If yes, did you put a SELECT statement there?
|
|
|
|
|
If everything is working when you run the query manually (sounds like you have verified this already), use method #3 and check if name is null, and if not, check name.GetType() to see what the framework thinks the type being returned from the command is.
|
|
|
|
|
Those look reasonable, but check for System.DBNull.Value
Here's my current code for ExecuteScalar:
public virtual T
ExecuteScalar<T>
(
T IfNull
)
{
lock ( this.command )
{
try
{
this.OpenCount++ ;
object result = this.command.ExecuteScalar() ;
if ( ( result == null ) || ( result == System.DBNull.Value ) )
{
result = IfNull ;
}
else if ( typeof(T) != result.GetType() )
{
result = System.Convert.ChangeType
(
result
,
typeof(T)
) ;
}
this.RaiseEvent ( this.OnSuccess , 1 , null ) ;
return ( (T) result ) ;
}
catch ( System.Exception err )
{
throw ( this.WrapException
(
"ExecuteScalar"
,
this.command
,
err
) ) ;
}
finally
{
this.OpenCount-- ;
}
}
}
|
|
|
|
|
Hi all,
In my windows application by using the openfiledialog box i am selecting a program or .exe application.
After selecting i want to get the signature of the application which i have selected.
Is it possible in c#.If yes how can i ?
Thanks in advance.
|
|
|
|
|
What do you mean by signature? Are you talking about the digital signature, or do you mean something else?
|
|
|
|
|
|
This[^] article might help you.
|
|
|
|
|
No idea why this answer was downvoted!
Have my 5+
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Thanks. Lately, I see many univotes to my answers and posts. I raised my concern at the Site Bugs & Suggestions forum, it was rejected outright.
|
|
|
|
|
Please clarify on what do you mean by signature of the application and what do you want to do with this signature.....
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
hello guys... Lets say I have a text box on a form. I was trying to get the coordinates of a specific letter i-e "." (dot) when I type it, in text box on the form. For simple drawing this can be done but for typing, I am finding it hard. Any pointers will be appreciated...thnx
|
|
|
|
|
I think some lateral thinking is required for this.
First, find the coordinates of the text starting position. That will be the text box's Location, plus a bit for borders and padding, which you can either hard code as an assumption or infer from the difference between Size and ClientSize.
Then measure the text, using Graphics.MeasureCharacterRanges[^]* (you can create a graphics object from the text box itself if you don't have one). Use the Font object from the text box. Note that you aren't measuring the text within the textbox, but you're measuring the same string with the same font in the same graphics context, so it should be the right answer!
Finally simply add the measured text size to the inferred start of the client area.
(*: Not MeasureString. See this short article[^].)
|
|
|
|
|
nicely explained.......
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|