Click here to Skip to main content
15,892,575 members
Home / Discussions / Database
   

Database

 
AnswerRe: difference between sql,ms sql and sqlserver 2000 Pin
Ashfield29-Apr-08 21:17
Ashfield29-Apr-08 21:17 
JokeRe: difference between sql,ms sql and sqlserver 2000 Pin
Youtea30-Apr-08 20:48
Youtea30-Apr-08 20:48 
QuestionHow to create a table on Click event Pin
sacr8329-Apr-08 20:25
sacr8329-Apr-08 20:25 
AnswerRe: How to create a table on Click event Pin
Ashfield29-Apr-08 21:26
Ashfield29-Apr-08 21:26 
AnswerRe: How to create a table on Click event Pin
Blue_Boy29-Apr-08 21:29
Blue_Boy29-Apr-08 21:29 
GeneralRe: How to create a table on Click event Pin
Ashfield30-Apr-08 0:01
Ashfield30-Apr-08 0:01 
GeneralRe: How to create a table on Click event Pin
Blue_Boy30-Apr-08 0:55
Blue_Boy30-Apr-08 0:55 
AnswerRe: How to create a table on Click event Pin
Rohan Priya30-Apr-08 3:52
Rohan Priya30-Apr-08 3:52 
Hi Chinthaka ,
You can write the following code in the button onclick event . Before that you should import System.Data.SqlClient namespace .

<br />
           SqlConnection conn= new SqlConnection("ConnectionString");<br />
			conn.Open();<br />
			MessageBox.Show("Connection est.."); <br />
			SqlCommand comCreate = new SqlCommand("CREATE  TABLE  EMP_TABLE_CREATE(EmpID INT , EmpName  VARCHAR(20))",conn);<br />
			int intCreate = comCreate.ExecuteNonQuery();<br />
            MessageBox.Show("Table Created.." + intCreate); <br />
            SqlCommand conInsert = new SqlCommand("INSERT INTO EMP_TABLE_CREATE VALUES(11,'MyName')",conn ) ;<br />
		    int intInsert = conInsert.ExecuteNonQuery(); <br />
			MessageBox.Show("Row Inserted.." + intInsert); <br />
			MessageBox.Show("Displaying Row : "); <br />
			SqlCommand conSelect = new SqlCommand("SELECT * FROM EMP_TABLE_CREATE",conn) ;<br />
			SqlDataReader dr= conSelect.ExecuteReader(); <br />
			dr.Read();<br />
			while(dr.HasRows)<br />
			{<br />
                              MessageBox.Show(dr.GetInt32(0).ToString() +":"+dr.GetString(1)) ; <br />
				dr.NextResult(); <br />
			}<br />
			conn.Close(); <br />


Hope this is what you wanted . Let me know if you have any further queries .
Thanks

Priya Rohan

QuestionSet autonumber in sql express Pin
Mekong River29-Apr-08 17:27
Mekong River29-Apr-08 17:27 
AnswerRe: Set autonumber in sql express Pin
Mekong River29-Apr-08 17:29
Mekong River29-Apr-08 17:29 
GeneralRecordset Recordcount Pin
MikeMarq29-Apr-08 8:29
MikeMarq29-Apr-08 8:29 
GeneralRe: Recordset Recordcount Pin
MikeMarq29-Apr-08 8:31
MikeMarq29-Apr-08 8:31 
GeneralRe: Recordset Recordcount Pin
Rob Graham30-Apr-08 3:29
Rob Graham30-Apr-08 3:29 
GeneralRe: Recordset Recordcount Pin
Luc Pattyn29-Apr-08 9:47
sitebuilderLuc Pattyn29-Apr-08 9:47 
GeneralRe: Recordset Recordcount Pin
MikeMarq29-Apr-08 13:39
MikeMarq29-Apr-08 13:39 
GeneralRe: Recordset Recordcount Pin
Blue_Boy29-Apr-08 15:25
Blue_Boy29-Apr-08 15:25 
GeneralRe: Recordset Recordcount Pin
Blue_Boy29-Apr-08 10:20
Blue_Boy29-Apr-08 10:20 
QuestionLink DBase III Files in SQL Server 2000 Pin
Behzad Ordubadi29-Apr-08 5:43
professionalBehzad Ordubadi29-Apr-08 5:43 
GeneralDTS Pin
kibromg29-Apr-08 5:32
kibromg29-Apr-08 5:32 
GeneralRe: DTS Pin
Mark J. Miller29-Apr-08 7:38
Mark J. Miller29-Apr-08 7:38 
GeneralRe: DTS Pin
kibromg30-Apr-08 2:25
kibromg30-Apr-08 2:25 
GeneralRe: DTS Pin
Mark J. Miller30-Apr-08 4:08
Mark J. Miller30-Apr-08 4:08 
GeneralRe: DTS [modified] Pin
kibromg30-Apr-08 5:42
kibromg30-Apr-08 5:42 
GeneralRe: DTS Pin
Mark J. Miller30-Apr-08 5:56
Mark J. Miller30-Apr-08 5:56 
QuestionCould we move database from SQL Server 2000 to SQL Server 7.0 ? Pin
bug_aonz29-Apr-08 5:28
bug_aonz29-Apr-08 5:28 

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.