Click here to Skip to main content
15,888,269 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to avoid Stream.Read() block when internet connection is suddenly down? Pin
Chesnokov Yuriy13-Jun-11 9:06
professionalChesnokov Yuriy13-Jun-11 9:06 
QuestionAdd the RegularExpressionValidator on the server side Pin
vanikanc13-Jun-11 4:45
vanikanc13-Jun-11 4:45 
AnswerRe: Add the RegularExpressionValidator on the server side Pin
Not Active13-Jun-11 6:54
mentorNot Active13-Jun-11 6:54 
GeneralRe: Add the RegularExpressionValidator on the server side Pin
vanikanc13-Jun-11 7:04
vanikanc13-Jun-11 7:04 
GeneralRe: Add the RegularExpressionValidator on the server side Pin
Not Active13-Jun-11 7:46
mentorNot Active13-Jun-11 7:46 
GeneralRe: Add the RegularExpressionValidator on the server side Pin
vanikanc13-Jun-11 7:48
vanikanc13-Jun-11 7:48 
GeneralRe: Add the RegularExpressionValidator on the server side Pin
Not Active13-Jun-11 8:37
mentorNot Active13-Jun-11 8:37 
QuestionBasic Insert Row Question Pin
AmbiguousName13-Jun-11 1:46
AmbiguousName13-Jun-11 1:46 
hello guys.. a basic question about inserting row in the sql server. I made all the necessary arrangements first (like creating a login then enabling it, changing the login mode to Mix-Mode). But following code is not working, I dont know what is the problem in the connection string
string connectionString = "Data Source=srv032k3; Initial Catalog=MuzeDB;Integrated Security=SSPI; User ID=sa; Password=;sa";
SqlConnection connection = new SqlConnection(connectionString);

try
{
    connection.Open();
    SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM students ORDER BY Id", connection);
    SqlCommandBuilder command = new SqlCommandBuilder(adapter);

    //create a dataset object
    DataSet ds = new DataSet("StudentsSet");
    adapter.Fill(ds, "students");

    //create a new datatable object
    DataTable dt = ds.Tables["students"];
    DataRow row = dt.NewRow();

    //give value for the new row
    int id;
    string name, address;
    id = 4;
    name = "Nadeem";
    address = "Layya";

    row["Id"] = id;
    row["Name"] = name;
    row["Address"] = address;
    dt.Rows.Add(row);

    adapter.Update(ds, "students");

    Console.WriteLine("A new row added: {0} {1} {2}", id, name, address);

    connection.Close();
}
catch (Exception ex)
{ Console.WriteLine(ex.Message); }

what can be the problem? thnx
AnswerRe: Basic Insert Row Question Pin
Pete O'Hanlon13-Jun-11 2:07
mvePete O'Hanlon13-Jun-11 2:07 
GeneralRe: Basic Insert Row Question Pin
AmbiguousName13-Jun-11 2:30
AmbiguousName13-Jun-11 2:30 
GeneralRe: Basic Insert Row Question Pin
Pete O'Hanlon13-Jun-11 2:51
mvePete O'Hanlon13-Jun-11 2:51 
AnswerRe: Basic Insert Row Question Pin
phil.o13-Jun-11 2:16
professionalphil.o13-Jun-11 2:16 
GeneralRe: Basic Insert Row Question Pin
AmbiguousName13-Jun-11 2:29
AmbiguousName13-Jun-11 2:29 
GeneralRe: Basic Insert Row Question Pin
phil.o13-Jun-11 2:35
professionalphil.o13-Jun-11 2:35 
GeneralRe: Basic Insert Row Question Pin
AmbiguousName13-Jun-11 2:42
AmbiguousName13-Jun-11 2:42 
GeneralRe: Basic Insert Row Question Pin
phil.o13-Jun-11 2:49
professionalphil.o13-Jun-11 2:49 
AnswerRe: Basic Insert Row Question Pin
RaviRanjanKr13-Jun-11 2:48
professionalRaviRanjanKr13-Jun-11 2:48 
AnswerRe: Basic Insert Row Question Pin
BobJanova13-Jun-11 3:25
BobJanova13-Jun-11 3:25 
AnswerRe: Basic Insert Row Question Pin
AmbiguousName13-Jun-11 18:34
AmbiguousName13-Jun-11 18:34 
Questionhow to monitor downloaded and uploaded data Pin
Aisha sharma12-Jun-11 22:17
Aisha sharma12-Jun-11 22:17 
QuestionHow to create xml file in disk location using SQL Server 2005 & C#...? Pin
Manish_Kumar_Nayak12-Jun-11 21:03
Manish_Kumar_Nayak12-Jun-11 21:03 
AnswerRe: How to create xml file in disk location using SQL Server 2005 & C#...? Pin
Richard MacCutchan12-Jun-11 23:46
mveRichard MacCutchan12-Jun-11 23:46 
AnswerRe: How to create xml file in disk location using SQL Server 2005 & C#...? Pin
jschell13-Jun-11 8:43
jschell13-Jun-11 8:43 
QuestionGetting data from host, convert to string and then to bytes again. Pin
krosty478212-Jun-11 13:06
krosty478212-Jun-11 13:06 
AnswerRe: Getting data from host, convert to string and then to bytes again. Pin
Luc Pattyn12-Jun-11 13:42
sitebuilderLuc Pattyn12-Jun-11 13: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.