Click here to Skip to main content
15,917,617 members
Home / Discussions / Database
   

Database

 
Questionconnection pro again Pin
skyeddie6-Aug-06 0:49
skyeddie6-Aug-06 0:49 
AnswerRe: connection pro again Pin
Christian Graus6-Aug-06 1:16
protectorChristian Graus6-Aug-06 1:16 
AnswerRe: connection pro again Pin
Rob Graham6-Aug-06 4:26
Rob Graham6-Aug-06 4:26 
GeneralRe: connection pro again Pin
skyeddie6-Aug-06 19:59
skyeddie6-Aug-06 19:59 
GeneralRe: connection pro again Pin
Rob Graham7-Aug-06 3:43
Rob Graham7-Aug-06 3:43 
Questioninserting data thru web forms Pin
Kunal P6-Aug-06 0:23
Kunal P6-Aug-06 0:23 
AnswerRe: inserting data thru web forms Pin
Christian Graus6-Aug-06 1:21
protectorChristian Graus6-Aug-06 1:21 
GeneralRe: inserting data thru web forms Pin
Kunal P7-Aug-06 6:40
Kunal P7-Aug-06 6:40 
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...."Frown | :(

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

QuestionHow to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#5-Aug-06 21:10
Rocky#5-Aug-06 21:10 
AnswerRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Christian Graus6-Aug-06 1:22
protectorChristian Graus6-Aug-06 1:22 
AnswerRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#6-Aug-06 9:25
Rocky#6-Aug-06 9:25 
GeneralRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#6-Aug-06 9:33
Rocky#6-Aug-06 9:33 
QuestionRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#6-Aug-06 9:38
Rocky#6-Aug-06 9:38 
AnswerRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Izak -7-Aug-06 0:12
Izak -7-Aug-06 0:12 
GeneralRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#7-Aug-06 3:23
Rocky#7-Aug-06 3:23 
QuestionRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#7-Aug-06 3:28
Rocky#7-Aug-06 3:28 
AnswerRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#7-Aug-06 20:04
Rocky#7-Aug-06 20:04 
GeneralRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
_AK_7-Aug-06 20:12
_AK_7-Aug-06 20:12 
QuestionRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#8-Aug-06 20:45
Rocky#8-Aug-06 20:45 
AnswerRe: How to iterate thru all the elements of Datagrid (windows forms) Pin
Rocky#8-Aug-06 21:18
Rocky#8-Aug-06 21:18 
QuestionNo service found for SQL Pin
Skanless4-Aug-06 15:58
Skanless4-Aug-06 15:58 
AnswerRe: No service found for SQL Pin
Rob Graham5-Aug-06 4:02
Rob Graham5-Aug-06 4:02 
GeneralRe: No service found for SQL Pin
Skanless7-Aug-06 18:43
Skanless7-Aug-06 18:43 
QuestionShifting over a string Pin
Tom Wright4-Aug-06 8:50
Tom Wright4-Aug-06 8:50 
AnswerRe: Shifting over a string Pin
Eric Dahlvang4-Aug-06 9:12
Eric Dahlvang4-Aug-06 9:12 

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.