I have a textbox called "textBox6.text" in a C# Windows Application in Visual Studio, and i want that the text entered by the user in the textbox should be added to the "PURPOSE" field in a table "TABLE2_HDB1" in Oracle database "HDB1" on clicking a "submit" button.
the coding for submit button is as follows:-
private void button1_Click(object sender, EventArgs e)
OleDbConnection cn = null;
OleDbCommand cmd = null;
OracleStmt = "insert into TABLE2_HDB1(PURPOSE) values(@PURPOSE)";
ConString = " Provider=MSDAORA;Data Source=HDb1;User Id=SYSTEM
cn = new OleDbConnection(ConString);
cmd = new OleDbCommand(OracleStmt, cn);
cmd.Parameters.Add(new OleDbParameter("@PURPOSE", OleDbType.VarChar , 20));
cmd.Parameters["@PURPOSE"].Value = textBox6.Text;
textBox8 .Text = "record inserted successfully";
catch (Exception ex)
textBox8 .Text = ex.Message;
on executing this code u get the error :-
My Sql Server 2000 Table 'Feedback' structure is look like this.....Code, Q1, Q2, Q3 and records are like...
Code Q1 Q2 Q3
1 Good Good Average
2 Poor Average Average
3 Good Excellent Average
4 Excellent Good Good
I need to write a single query, which will give result look like.
Excellent Good Average Poor
Q1 1 2 0 1
Q2 1 2 1 0
Q3 0 1 3 0
Actually, this table is used to get the feedback from the users. User has given their feedback by selecting options. I need the details that how many persons answered Excellent for Question1 (Q1), Question2 (Q2), etc...As well as How many answered Good for Q1,Q2,Q3, etc....I need this format. Please help me.
I have written the following query in SQL Server but did not work saying error with the word PIVOT but worked with MS-Access
but I cannot create a table with the select statement.I want the Pivot Table to go in a table but the INTO [Table] doesn't work.
Following is the query
TRANSFORM Sum(Cap) AS AvgOfCap;
SELECT JobWorker FROM Cap GROUP BY JobWorker order by JobWorker PIVOT TimePeriod;
By the way, what are you doing if there is 5 weeks in a month
Declare @Date datetime
When (datediff(week,(@Date -datepart(dd,@Date)+1),@Date)+1) in (1,3) then 'Workdays 6'
When (datediff(week,(@Date -datepart(dd,@Date)+1),@Date)+1) in (2,4) then 'Workdays 5'
When (datediff(week,(@Date -datepart(dd,@Date)+1),@Date)+1)=5 then 'What Now'
I have to develop an application using SQL Server2000. It is a client server application having one server and at most 10 clients. Does SQL Server 2000 Desktop Edition support Client Server Architecture and what is maximum number of clients that may connect concurrently.
I wish not to use SQL Server Enterprise Edition as it requires Server operating system for its installation but my application is targeted to run on Windows XP Professional
Looking forward for timely responce please....
Create another column name DateT as a datetime field
Convert your existing date data into the DateT field
When storing date data only store the date (today) unless you need the time component (now).
If you store the time component then you cannot select on '2008-Jul-15' as the actual value may be '2008-Jul-15 04:23:11' with the time component. This will force you to use between or format whenever you use the DateT field.
SELECT TOP 100
Never underestimate the power of human stupidity