Click here to Skip to main content
15,914,165 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionProblem in edititemtemplate in vb.net1.1 [modified] Pin
amaneet14-Jul-06 19:42
amaneet14-Jul-06 19:42 
Questiongeneral Pin
dansoft14-Jul-06 19:21
dansoft14-Jul-06 19:21 
AnswerRe: general Pin
Colin Angus Mackay15-Jul-06 13:28
Colin Angus Mackay15-Jul-06 13:28 
QuestionHow to bind data in datagrid Pin
ypsyong14-Jul-06 18:28
ypsyong14-Jul-06 18:28 
AnswerRe: How to bind data in datagrid Pin
postmaster@programmingknowledge.com14-Jul-06 19:11
postmaster@programmingknowledge.com14-Jul-06 19:11 
JokeRe: How to bind data in datagrid Pin
Jerry Hammond15-Jul-06 4:29
Jerry Hammond15-Jul-06 4:29 
AnswerRe: How to bind data in datagrid Pin
enjoycrack15-Jul-06 20:12
enjoycrack15-Jul-06 20:12 
QuestionI need a lolution for Connection String. Pin
tranglt14-Jul-06 18:27
tranglt14-Jul-06 18:27 
Hi Everyone!
I have a proplem of connection string to connect database

I have a SQL server, thi Name server this MSSQLxxx; (Not Local)
User: Xman;
Pass: Xmankk;
DataBase: TLxxx;

Now, I Dev a website in .Net 1.x & SQLSERVER 2000.
I use a connection string:
"user id=Xman;pwd=Xmankk;data source=MSSQLxxx;initial catalog=TLxxx;timeout=90"

But, can not connect to database.
I try doing connect to the database by tool of sqlserver 2000, it is sucessful, I can view all information of the data (TLxxx), I can view Tables, views ,... I can Create table there.

This is the my code:

public class UserDB
{
private string connectionString;

public UserDB()
{
// I try Hardcode to test connection string.
connectionString = "user id=Xman;pwd=Xmankk;data source=MSSQLxxx;initial catalog=TLxxx;timeout=90";//ConfigurationSettings.AppSettings["connectionString"];
}

public int GetUserID(string userName, string pass)
{
SqlConnection con = new SqlConnection(connectionString);

SqlCommand cmd = new SqlCommand("TL_GetUserID", con);
cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.Add(new SqlParameter("@userName", SqlDbType.NVarChar,50));
cmd.Parameters["@userName"].Value = userName;
cmd.Parameters.Add(new SqlParameter("@password", SqlDbType.NVarChar,32));
cmd.Parameters["@password"].Value = pass;

try
{
con.Open();
SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.SingleRow);

if (reader.Read())
{
return Convert.ToInt32(reader["UserID"]);
}
else
{
return -1;
}
}
catch(SqlException)
{
throw new ApplicationException("data ");
}
finally
{
con.Close();
}

return -1;
}
....
}

Please, show me solution.
Many Thank.




I Don't Want Say No Wealth
AnswerRe: I need a lolution for Connection String. Pin
enjoycrack15-Jul-06 20:14
enjoycrack15-Jul-06 20:14 
QuestionHow to print a web page report Pin
ypsyong14-Jul-06 18:22
ypsyong14-Jul-06 18:22 
AnswerRe: How to print a web page report Pin
enjoycrack15-Jul-06 20:16
enjoycrack15-Jul-06 20:16 
QuestionASP.Net Current Active User Sessions Pin
Clickok14-Jul-06 13:23
Clickok14-Jul-06 13:23 
AnswerRe: ASP.Net Current Active User Sessions Pin
enjoycrack15-Jul-06 20:18
enjoycrack15-Jul-06 20:18 
QuestionWhat's the problem? Pin
User 309585914-Jul-06 11:26
User 309585914-Jul-06 11:26 
AnswerRe: What's the problem? Pin
Mircea Grelus15-Jul-06 0:48
Mircea Grelus15-Jul-06 0:48 
AnswerRe: What's the problem? Pin
RichardGrimmer17-Jul-06 2:58
RichardGrimmer17-Jul-06 2:58 
QuestionTreeView built dynamically: IHierarchicalDataSource and how to set Node.Text [modified] Pin
phuryn14-Jul-06 10:15
phuryn14-Jul-06 10:15 
QuestionDataList Pin
ADY00714-Jul-06 10:12
ADY00714-Jul-06 10:12 
AnswerRe: DataList Pin
deepaktripathi14-Jul-06 11:05
deepaktripathi14-Jul-06 11:05 
AnswerRe: DataList Pin
deepaktripathi14-Jul-06 11:07
deepaktripathi14-Jul-06 11:07 
QuestionReportviewer control in c#+ASP.net2.0 + postgres Pin
deepaktripathi14-Jul-06 9:51
deepaktripathi14-Jul-06 9:51 
QuestionDataset output to Label [modified] Pin
NiPsTeRs14-Jul-06 7:16
NiPsTeRs14-Jul-06 7:16 
AnswerRe: Dataset output to Label Pin
Not Active14-Jul-06 9:09
mentorNot Active14-Jul-06 9:09 
GeneralRe: Dataset output to Label Pin
NiPsTeRs14-Jul-06 11:11
NiPsTeRs14-Jul-06 11:11 
QuestionUsing asynchronous socket on asp.net page Pin
Rookie14-Jul-06 6:16
Rookie14-Jul-06 6:16 

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.