Click here to Skip to main content
15,887,267 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionClosing and Disposing Excel Application Process in C# Pin
Pramod_Kumar14-Feb-20 4:26
Pramod_Kumar14-Feb-20 4:26 
AnswerRe: Closing and Disposing Excel Application Process in C# Pin
Richard Deeming4-Feb-20 4:37
mveRichard Deeming4-Feb-20 4:37 
Questionconverting text file data from string to X,Y,Z coordinates Pin
Sher Shah 11-Feb-20 3:32
Sher Shah 11-Feb-20 3:32 
AnswerRe: converting text file data from string to X,Y,Z coordinates Pin
Pete O'Hanlon1-Feb-20 4:10
mvePete O'Hanlon1-Feb-20 4:10 
GeneralRe: converting text file data from string to X,Y,Z coordinates Pin
Sher Shah 11-Feb-20 5:11
Sher Shah 11-Feb-20 5:11 
GeneralRe: converting text file data from string to X,Y,Z coordinates Pin
phil.o1-Feb-20 6:28
professionalphil.o1-Feb-20 6:28 
QuestionApplication wide information into classes in referenced DLL's Pin
A D Rosser28-Jan-20 4:22
A D Rosser28-Jan-20 4:22 
AnswerRe: Application wide information into classes in referenced DLL's Pin
Richard Deeming28-Jan-20 4:32
mveRichard Deeming28-Jan-20 4:32 
Store the connection string in the application's configuration file, and have the "functionality" class read it from there.

Eg:
XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <connectionStrings>
        <add
            name="Functionality"
            connectionString="........."
            providerName="System.Data.SqlClient"
        />
    </connectionStrings>
</configuration>
VB.NET
Private Shared Function CreateConnection() As SqlConnection
    Dim connectionString As String = ConfigurationManager.ConnectionStrings("Functionality").ConnectionString
    Return New SqlConnection(connectionString)
End Function
If you need to access more than one database in a single application, you'll need to modify your classes so that you can pass in the connection string name somehow. You can still read the actual connection string from the configuration file.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Application wide information into classes in referenced DLL's Pin
A D Rosser29-Jan-20 5:04
A D Rosser29-Jan-20 5:04 
AnswerRe: Application wide information into classes in referenced DLL's Pin
Gerry Schmitz28-Jan-20 4:40
mveGerry Schmitz28-Jan-20 4:40 
GeneralRe: Application wide information into classes in referenced DLL's Pin
A D Rosser29-Jan-20 5:13
A D Rosser29-Jan-20 5:13 
GeneralRe: Application wide information into classes in referenced DLL's Pin
Eddy Vluggen29-Jan-20 6:48
professionalEddy Vluggen29-Jan-20 6:48 
GeneralRe: Application wide information into classes in referenced DLL's Pin
watchmeoni9-Mar-20 14:18
watchmeoni9-Mar-20 14:18 
AnswerRe: Application wide information into classes in referenced DLL's Pin
Mycroft Holmes28-Jan-20 10:13
professionalMycroft Holmes28-Jan-20 10:13 
GeneralRe: Application wide information into classes in referenced DLL's Pin
A D Rosser29-Jan-20 5:17
A D Rosser29-Jan-20 5:17 
GeneralRe: Application wide information into classes in referenced DLL's Pin
Mycroft Holmes29-Jan-20 10:31
professionalMycroft Holmes29-Jan-20 10:31 
QuestionHow to export multiple image to excel in .Net core Pin
Member 1422622525-Jan-20 4:52
Member 1422622525-Jan-20 4:52 
QuestionSubtract number for each row from datagridview1 to datagridview2 and display to answer to datagridview3 Pin
percy0521-Jan-20 15:32
percy0521-Jan-20 15:32 
AnswerRe: Subtract number for each row from datagridview1 to datagridview2 and display to answer to datagridview3 Pin
Richard MacCutchan21-Jan-20 21:32
mveRichard MacCutchan21-Jan-20 21:32 
QuestionGetting Error System.IO.InvalidDataException: 'End of Central Directory record could not be found Pin
simpledeveloper2-Jan-20 8:10
simpledeveloper2-Jan-20 8:10 
AnswerRe: Getting Error System.IO.InvalidDataException: 'End of Central Directory record could not be found Pin
Eddy Vluggen2-Jan-20 10:29
professionalEddy Vluggen2-Jan-20 10:29 
AnswerRe: Getting Error System.IO.InvalidDataException: 'End of Central Directory record could not be found Pin
Richard MacCutchan2-Jan-20 21:55
mveRichard MacCutchan2-Jan-20 21:55 
Questionwhat is tuple in mvc Pin
Anil Sharma198326-Dec-19 5:29
professionalAnil Sharma198326-Dec-19 5:29 
AnswerRe: what is tuple in mvc Pin
Pete O'Hanlon26-Dec-19 6:38
mvePete O'Hanlon26-Dec-19 6:38 
AnswerRe: what is tuple in mvc Pin
Eddy Vluggen26-Dec-19 11:42
professionalEddy Vluggen26-Dec-19 11:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.