16,018,664 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by arun.emm (Top 9 by date)
arun.emm
16-Feb-12 7:54am
View
Here's my coding..
SqlTransaction OraTrans = null;
string sNoOfRecAff = null;
string sDBPath = Application.StartupPath + "\\DB\\SKTDB.mdf";
if (System.IO.File.Exists(sDBPath))
{
strConnString = "Data Source=.\\SQLEXPRESS;AttachDbFilename='" + sDBPath + "';User ID=sa;Password=1234";
}
string strSQL = "INSERT INTO EmpDetails(StaffCode, FirstName, LastName, Gender, DOB, Age, Father_Hus_Name, Address, Mobileno, Experience, prevCompAdd, DOJ, Designation, BasicSalary) VALUES(" + txt_code.Text + ",'" + txt_fname.Text + "','" + txt_lname.Text + "','" + g + "','" + dob + "','" + txt_age.Text + "','" + txt_father.Text + "','" + txt_addr.Text + "','" + txt_mobile.Text + "','" + cb_exp.SelectedItem.ToString() + "','" + txt_previousco.Text + "','" + doj + "','" + txt_desig.Text + "','" + txt_basic.Text + "')";
try
{
myConn = new SqlConnection(strConnString); myConn.Open(); OraTrans = myConn.BeginTransaction();
//myCmd.Transaction = OraTrans;
myCmd = new SqlCommand(strSQL, myConn, OraTrans);
sNoOfRecAff = myCmd.ExecuteNonQuery().ToString();
OraTrans.Commit();
OraTrans.Dispose();
return sNoOfRecAff;
}
catch (Exception ex)
{
OraTrans.Rollback();
return ex.Message;
}
finally
{
myConn.Close();
myCmd.Dispose();
myConn.Dispose();
}
is this a right way to do it?..
arun.emm
16-Feb-12 7:49am
View
Here's my coding..
SqlTransaction OraTrans = null;
string sNoOfRecAff = null;
string sDBPath = Application.StartupPath + "\\DB\\SKTDB.mdf";
if (System.IO.File.Exists(sDBPath))
{
strConnString = "Data Source=.\\SQLEXPRESS;AttachDbFilename='" + sDBPath + "';User ID=sa;Password=1234";
}
string strSQL = "INSERT INTO EmpDetails(StaffCode, FirstName, LastName, Gender, DOB, Age, Father_Hus_Name, Address, Mobileno, Experience, prevCompAdd, DOJ, Designation, BasicSalary) VALUES(" + txt_code.Text + ",'" + txt_fname.Text + "','" + txt_lname.Text + "','" + g + "','" + dob + "','" + txt_age.Text + "','" + txt_father.Text + "','" + txt_addr.Text + "','" + txt_mobile.Text + "','" + cb_exp.SelectedItem.ToString() + "','" + txt_previousco.Text + "','" + doj + "','" + txt_desig.Text + "','" + txt_basic.Text + "')";
try
{
myConn = new SqlConnection(strConnString);
myConn.Open();
OraTrans = myConn.BeginTransaction();
//myCmd.Transaction = OraTrans;
myCmd = new SqlCommand(strSQL, myConn, OraTrans);
sNoOfRecAff = myCmd.ExecuteNonQuery().ToString();
OraTrans.Commit();
OraTrans.Dispose();
return sNoOfRecAff;
}
catch (Exception ex)
{
OraTrans.Rollback();
return ex.Message;
}
finally
{
myConn.Close();
myCmd.Dispose();
myConn.Dispose();
}
arun.emm
16-Feb-12 7:29am
View
Hi Rahul ,
Thanks for your reply.. But i dont want to create database and tables in sql management studio. I want to create database within the application folder using server explorer of vs 2008. And i've created it already but got a problem which i have stated above.
arun.emm
20-Sep-11 7:03am
View
Hi ,
select emp_Code, [Dates], [1] intime ,[2] break_out,[3] break_in,[4] outtime
from
(select emp_code,convert(date,[DATES]) [date],convert(time,[times]) time ,ROW_NUMBER() over(partition by emp_code,dates order by emp_code,dates) Tin from punch_details
)data
pivot
(
max([times])
for Tin in ([1],[2],[3],[4])
)p
the above query returns the following error ,
"Incorrect syntax near 'pivot'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel".
arun.emm
20-Sep-11 7:01am
View
Deleted
Hi ,
select emp_Code, [Dates], [1] intime ,[2] break_out,[3] break_in,[4] outtime
from
(select empcode,convert(date,[DATES]) [date],convert(time,[times]) time ,ROW_NUMBER() over(partition by emp_code,dates order by emp_code,dates) Tin from punch_details
)data
pivot
(
max([times])
for Tin in ([1],[2],[3],[4])
)p
the above query returns the following error ,
"Incorrect syntax near 'pivot'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel".
arun.emm
14-Sep-11 0:44am
View
yes , u r ryt.. A class would be better.. I'll work on that.. Thanks alt for ur replies..
arun.emm
21-Oct-10 1:53am
View
I have already added this in the web.config file..but Still not working.. what do i do?..
arun.emm
21-Oct-10 1:52am
View
I have already added this in the web.config file..
<httpruntime maxrequestlength="2097151" executiontimeout="3600">
Still not working.. what do i do?..
arun.emm
15-Oct-10 1:58am
View
Hi ,
Rajesh n raju... there is no problem with host address or username or password.. this coding works well if i run it on local server. even i'll be able to upload the larger file.. but after hosting , its no longer working. after hosted , it works for smaller files, say below 2 mb but not working for the larger files.. any suggestions??..
Show More