Click here to Skip to main content
16,020,103 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to disable Outlook security alerts? Pin
Dave Kreskowiak7-Aug-06 1:30
mveDave Kreskowiak7-Aug-06 1:30 
GeneralRe: How to disable Outlook security alerts? Pin
sinanju6-Aug-06 22:57
sinanju6-Aug-06 22:57 
GeneralRe: How to disable Outlook security alerts? Pin
Dave Kreskowiak7-Aug-06 1:28
mveDave Kreskowiak7-Aug-06 1:28 
QuestionCSharp Parser ? Pin
Guneendra6-Aug-06 1:00
Guneendra6-Aug-06 1:00 
AnswerRe: CSharp Parser ? Pin
Ravi Bhavnani6-Aug-06 5:37
professionalRavi Bhavnani6-Aug-06 5:37 
Questioninserting data thru forms Pin
Kunal P6-Aug-06 0:23
Kunal P6-Aug-06 0:23 
AnswerRe: inserting data thru forms Pin
signbit6-Aug-06 3:06
signbit6-Aug-06 3:06 
GeneralRe: inserting data thru forms Pin
Kunal P7-Aug-06 6:47
Kunal P7-Aug-06 6:47 
i coded a bit.. but now sql database i showing an error if i keep the field "Username" as a primary key.

firstly the data is entered in a very ad-hoc fashion.. there is a row empty at the top...data entered in between two rows which are already filled with data..

and if i delete some data,then i get the error as
"Another user has modified the contents of the table,the database row ur modifying no longer exists in the database....... violation of PRIMARY KEY constraint...."

THE CODE:-

try
{
SqlConnection conn = new SqlConnection("server=(local);" +
"database=path;" +
"connection timeout=3;" +
"Trusted_Connection=yes;" +
"Integrated Security=true;" +
"user id=sa;" +
"password=");

conn.Open();


SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;

cmd.CommandText = "Insert into login(Username,Password) values('"+uname.Text+"','"+pass.Text+"')" ;
SqlDataReader dread = cmd.ExecuteReader();
if (dread.Read())
{
failed.Text = "Could not add the user";
}

else
{

Response.Redirect("success.aspx");
}
conn.Close();

}
catch(Exception kp)
{
failed.Text=kp.Message;
}
}

Kunal Piyush

QuestionInheriting System.Windows.Forms.Button Pin
Shy Agam6-Aug-06 0:21
Shy Agam6-Aug-06 0:21 
AnswerRe: Inheriting System.Windows.Forms.Button Pin
Christian Graus6-Aug-06 0:34
protectorChristian Graus6-Aug-06 0:34 
GeneralRe: Inheriting System.Windows.Forms.Button Pin
Shy Agam6-Aug-06 0:53
Shy Agam6-Aug-06 0:53 
AnswerRe: Inheriting System.Windows.Forms.Button Pin
3Dizard6-Aug-06 2:23
3Dizard6-Aug-06 2:23 
GeneralRe: Inheriting System.Windows.Forms.Button Pin
Shy Agam6-Aug-06 3:03
Shy Agam6-Aug-06 3:03 
GeneralRe: Inheriting System.Windows.Forms.Button Pin
FriendOfAsherah8-Nov-07 8:51
FriendOfAsherah8-Nov-07 8:51 
QuestionDatagrid Iteration Pin
Rocky#5-Aug-06 21:04
Rocky#5-Aug-06 21:04 
QuestionDotfuscator and GAC Pin
Ranjan Banerji5-Aug-06 17:15
Ranjan Banerji5-Aug-06 17:15 
AnswerRe: Dotfuscator and GAC Pin
Ranjan Banerji5-Aug-06 17:23
Ranjan Banerji5-Aug-06 17:23 
AnswerRe: Dotfuscator and GAC Pin
Mike Dimmick5-Aug-06 17:31
Mike Dimmick5-Aug-06 17:31 
Questionsetup package Pin
md_refay5-Aug-06 11:14
md_refay5-Aug-06 11:14 
AnswerRe: setup package Pin
Stanciu Vlad5-Aug-06 22:19
Stanciu Vlad5-Aug-06 22:19 
QuestionFlashing statusbar button Pin
Maksymus0075-Aug-06 11:13
Maksymus0075-Aug-06 11:13 
AnswerRe: Flashing statusbar button Pin
Thomas Stockwell7-Aug-06 12:43
professionalThomas Stockwell7-Aug-06 12:43 
Questionpublic variable Pin
md_refay5-Aug-06 11:11
md_refay5-Aug-06 11:11 
AnswerRe: public variable Pin
Vega025-Aug-06 12:03
Vega025-Aug-06 12:03 
Questionhow can i create a License for my applications Pin
keroed_edmond5-Aug-06 9:40
keroed_edmond5-Aug-06 9:40 

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.