Click here to Skip to main content
15,891,253 members
Home / Discussions / C#
   

C#

 
GeneralRe: Please Help me Pin
BillWoodruff4-Dec-11 15:33
professionalBillWoodruff4-Dec-11 15:33 
AnswerRe: Please Help me Pin
Abhinav S4-Dec-11 17:50
Abhinav S4-Dec-11 17:50 
GeneralRe: Please Help me Pin
Arunkumar.Koloth4-Dec-11 20:36
Arunkumar.Koloth4-Dec-11 20:36 
GeneralRe: Please Help me Pin
Pete O'Hanlon4-Dec-11 21:13
mvePete O'Hanlon4-Dec-11 21:13 
GeneralRe: Please Help me Pin
Wayne Gaylard4-Dec-11 21:17
professionalWayne Gaylard4-Dec-11 21:17 
GeneralRe: Please Help me Pin
Arunkumar.Koloth5-Dec-11 1:34
Arunkumar.Koloth5-Dec-11 1:34 
GeneralRe: Please Help me Pin
Wayne Gaylard5-Dec-11 1:43
professionalWayne Gaylard5-Dec-11 1:43 
QuestionDatabase Not Opening Pin
AmbiguousName4-Dec-11 2:55
AmbiguousName4-Dec-11 2:55 
hello guys..I am using stored procedures to get the data be shown in the gridview. Here is how I created SP in sql server.
SQL
CREATE PROCEDURE [dbo].[ShowStudent] AS
SELECT * FROM StudentInfo

And here is how I am incorporating this SP in C# sample.
C#
private void Form1_Load(object sender, EventArgs v)
{
  SqlConnection connection = new SqlConnection("Data Source=MUZE-LAPTOP\\SQLEXPRESS; Initial Catalog=StudentInfo;Integrated Security=SSPI;");
  SqlCommand command;
  DataTable dt = new DataTable();
  SqlDataAdapter adapter;

  try
  {
    connection.Open();
    command = new SqlCommand("ShowStudent", connection);
    adapter = new SqlDataAdapter(command);
    adapter.Fill(dt);
    connection.Close();
    dgStudents.DataSource = dt;
  }
  catch (Exception ex)
  { connection.Close(); MessageBox.Show(ex.Message); }

}

But it shows me the error
C#
Cannot Open Database 'Students' requested by the login. Login Failed. Login Failed for user 'Muze-Laptop\muze'

What can be the reason? thnx
AnswerRe: Database Not Opening Pin
Dan Mos4-Dec-11 3:15
Dan Mos4-Dec-11 3:15 
AnswerRe: Database Not Opening PinPopular
Wonde Tadesse4-Dec-11 8:19
professionalWonde Tadesse4-Dec-11 8:19 
GeneralRe: Database Not Opening Pin
Dan Mos4-Dec-11 8:54
Dan Mos4-Dec-11 8:54 
QuestionBind ReportViwer to DataSource dynamically Pin
Software20073-Dec-11 22:31
Software20073-Dec-11 22:31 
AnswerRe: Bind ReportViwer to DataSource dynamically Pin
preetham gd5-Dec-11 3:22
preetham gd5-Dec-11 3:22 
GeneralRe: Bind ReportViwer to DataSource dynamically Pin
Software20075-Dec-11 4:40
Software20075-Dec-11 4:40 
QuestionC# remoting with Sql server and store recordset Pin
kornkimhour2-Dec-11 22:31
kornkimhour2-Dec-11 22:31 
AnswerRe: C# remoting with Sql server and store recordset Pin
DaveyM693-Dec-11 12:55
professionalDaveyM693-Dec-11 12:55 
Questionget type of anonymous list Pin
zeeShan anSari2-Dec-11 9:30
zeeShan anSari2-Dec-11 9:30 
AnswerRepost Pin
Not Active2-Dec-11 9:44
mentorNot Active2-Dec-11 9:44 
AnswerRe: get type of anonymous list Pin
Wonde Tadesse2-Dec-11 16:48
professionalWonde Tadesse2-Dec-11 16:48 
QuestionIncluding an additional enum property into an object? Pin
Goalie352-Dec-11 9:20
Goalie352-Dec-11 9:20 
AnswerRe: Including an additional enum property into an object? Pin
Not Active2-Dec-11 9:47
mentorNot Active2-Dec-11 9:47 
AnswerRe: Including an additional enum property into an object? Pin
BillWoodruff2-Dec-11 19:27
professionalBillWoodruff2-Dec-11 19:27 
Questionstring concatenation: several seconds Pin
pirotrav2-Dec-11 2:35
pirotrav2-Dec-11 2:35 
AnswerRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 2:43
Rob Philpott2-Dec-11 2:43 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 2:48
pirotrav2-Dec-11 2:48 

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.