Click here to Skip to main content
15,913,773 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: C# HyperLink Control on Web Form Pin
AndieDu14-Jan-09 12:44
AndieDu14-Jan-09 12:44 
GeneralRe: C# HyperLink Control on Web Form Pin
Not Active14-Jan-09 15:26
mentorNot Active14-Jan-09 15:26 
AnswerRe: C# HyperLink Control on Web Form Pin
N a v a n e e t h14-Jan-09 15:56
N a v a n e e t h14-Jan-09 15:56 
GeneralRe: C# HyperLink Control on Web Form Pin
AndieDu14-Jan-09 17:22
AndieDu14-Jan-09 17:22 
QuestionLoginStatus Dynamic Visiblity not working Pin
Albert8314-Jan-09 7:58
Albert8314-Jan-09 7:58 
AnswerRe: LoginStatus Dynamic Visiblity not working Pin
saberbladez14-Jan-09 17:25
saberbladez14-Jan-09 17:25 
QuestionsqlConnection object Sql Server setup Pin
dwolver14-Jan-09 7:13
dwolver14-Jan-09 7:13 
AnswerRe: sqlConnection object Sql Server setup Pin
ToddHileHoffer14-Jan-09 7:24
ToddHileHoffer14-Jan-09 7:24 
There are two ways of doing integrated sql security. If you want to set permissions for each user (which I don't recommend) make sure you go into IIS and uncheck the allow anonymous access box for your web application. You will also need
<authentication mode="Windows"/> in your web.config.

What I do in my applications is create one windows account that has access to the database. Use a system account so that no one can use that account to log on to the machine. Then add the following your web.config


<authentication mode="Windows"/>
<identity impersonate="true" userName="yourDomain\yourSQLAccountUserName" password="PA$$word"/>

Then make sure the yourDomain\yourSQLAccountUserName account has appropriate rights in the database. Then if you want to do auditing you can always pass the userName of your current user in a sql parameter and update the table.

Also put your conn string in the web.config and use system.configuration.configurationmanager to get it.

Another thing is that it is best to use using blocks. Then you don't have to call close or dispose methods.

For example

public DataTable GetDataTable(string ProcName, SqlParameter[] parameters)
{
DataTable dt = new DataTable();
using (SqlCommand cmd = new SqlCommand(ProcName))
{
cmd.CommandType = CommandType.StoredProcedure;
using (SqlConnection conn = new SqlConnection(connString))
{
cmd.Connection = conn;
foreach (SqlParameter prm in parameters)
{
cmd.Parameters.Add(prm);
}
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.Connection.Open();
da.Fill(dt);
cmd.Parameters.Clear();
}
}
return dt;
}


I didn't get any requirements for the signature


Questionhow to View text file Pin
netJP12L14-Jan-09 6:15
netJP12L14-Jan-09 6:15 
AnswerRe: how to View text file Pin
ToddHileHoffer14-Jan-09 7:11
ToddHileHoffer14-Jan-09 7:11 
GeneralRe: how to View text file Pin
netJP12L14-Jan-09 7:30
netJP12L14-Jan-09 7:30 
GeneralRe: how to View text file Pin
ToddHileHoffer14-Jan-09 7:44
ToddHileHoffer14-Jan-09 7:44 
GeneralRe: how to View text file Pin
N a v a n e e t h14-Jan-09 15:59
N a v a n e e t h14-Jan-09 15:59 
AnswerRe: how to View text file Pin
MitchellBaldwin14-Jan-09 7:18
MitchellBaldwin14-Jan-09 7:18 
QuestionReading Excel Data Pin
Bharathy Sadagopan14-Jan-09 5:53
Bharathy Sadagopan14-Jan-09 5:53 
AnswerRe: Reading Excel Data Pin
pmarfleet14-Jan-09 11:10
pmarfleet14-Jan-09 11:10 
GeneralRe: Reading Excel Data Pin
Bharathy Sadagopan15-Jan-09 5:08
Bharathy Sadagopan15-Jan-09 5:08 
QuestionASP.NET Dynamic Data Pin
gantww14-Jan-09 5:42
gantww14-Jan-09 5:42 
QuestionDispose a datatable Pin
Member 236391614-Jan-09 4:48
Member 236391614-Jan-09 4:48 
AnswerRe: Dispose a datatable Pin
Aman Bhullar14-Jan-09 4:54
Aman Bhullar14-Jan-09 4:54 
GeneralRe: Dispose a datatable Pin
Christian Graus14-Jan-09 5:12
protectorChristian Graus14-Jan-09 5:12 
QuestionHow to use group by in datatable in c#? Pin
Member 236391614-Jan-09 3:04
Member 236391614-Jan-09 3:04 
QuestionAccess to bin folder denied because of forms authentication Pin
oceanexplorer8214-Jan-09 2:40
oceanexplorer8214-Jan-09 2:40 
Questionradio button binding Pin
cooltoad12314-Jan-09 2:26
cooltoad12314-Jan-09 2:26 
AnswerRe: radio button binding Pin
_AK_14-Jan-09 2:31
_AK_14-Jan-09 2:31 

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.