16,016,795 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 Javascript questions
View Visual Basic 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 Unni R (Top 41 by date)
Unni R
10-Dec-15 22:58pm
View
ajax script manager
Unni R
10-Dec-15 3:27am
View
<asp:TextBox ID="txtchkin" runat="server" Height="25px" Width="100px" ToolTip="Check In"
onkeypress="return OnlyDate(event)">
<cc1:CalendarExtender ID="txtchkin_CalendarExtender" runat="server"
Enabled="True" Format="dd/MMM/yyyy" TargetControlID="txtchkin">
while click on text box previous month calendar want to display
Unni R
10-Dec-15 3:16am
View
its not working
Unni R
28-Nov-15 6:48am
View
@echo off &setlocal
for /f "usebackq tokens=1* delims=," %%a in ("C:\SAUDIT\fileupload1.csv") do (
echo.%%a|findstr "\<node[0-9][0-9][0-9][0-9][0-9][0-9]\>\< [0-9][0-9][0-9][0-9][0-9][0-9]\>" >nul &&(
>>"C:\SAUDIT\fileupload5.csv" echo.%%a,%%b
)
)
I want to remove Node starting row. Belo code is not working
Unni R
14-Jul-15 5:24am
View
how to replace Filename
Unni R
14-Jul-15 1:41am
View
showing another eror
Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the varchar value '15.6' to data type int.
Unni R
13-Jul-15 5:20am
View
i need to change Filename as Login name. Below code is use to both login name and uploaded image name also showing
Unni R
13-Jul-15 4:16am
View
s. i need to change Filename as Login name
Unni R
8-Jul-15 5:48am
View
Deleted
Under REGIONCODE='005' 80 Branches . per day 5 times data will inserting to this table
Unni R
7-Jul-15 0:21am
View
Deleted
can u pls send any demo code
Unni R
6-Jul-15 6:28am
View
hourly data importing to table so how can avoid duplication .
Unni R
27-Jun-15 0:03am
View
SqlCommand cmd = new SqlCommand("select time,price from Dataupload",sc ); how to apply two dimensional array .
Unni R
25-Jun-15 5:18am
View
yes its working thanku...
Unni R
25-Jun-15 4:50am
View
Reader is alreday open .
Unni R
25-Jun-15 4:46am
View
SqlCommand cmd = new SqlCommand("select * from stockuser", SC);
SqlDataReader SDR = cmd.ExecuteReader();
string a = Txtusername.Text;
string b = Txtpassword.Text;
while (SDR.Read())
{ then also same error message
Unni R
16-Jun-15 5:39am
View
Deleted
string strSystemName = host.HostName;
string strPrinterName = "Generic / Text Only";
crreport.PrintOptions.PrinterName = strSystemName + strPrinterName;
am using this code but its not working
Unni R
16-Jun-15 5:26am
View
Deleted
can you please provide correct code , am new in dot net
Unni R
16-Jun-15 5:11am
View
Deleted
Printer installed in server and client system . Both are separate printers.can you please provide solution to print in local system.
Unni R
16-Jun-15 5:09am
View
Deleted
Printer installed in server and client system . Both are separate printers
Unni R
10-Jun-15 1:48am
View
My code attached here . My path(string reportFileName = @"C:\Bondreg\" + l + ".pdf";) while exporting time data saving to server system only . If possible to save data in local system .
protected void Button2_Click(object sender, EventArgs e)
{
List<string> l = new List<string>();
sc.Open();
SqlCommand cmd = new SqlCommand("select Fliono from BOND_REG where status='A'", sc);
SqlDataReader SDR = cmd.ExecuteReader();
while (SDR.Read() == true)
{
var item1 = SDR.GetValue(0).ToString();
l.Add(item1);
}
SDR.Close();
sc.Close();
for (int i = 0; i < l.Count; i++)
{
fileexport(l[i].ToString());
updatestaus(l[i].ToString());
}
SDR.Close();
sc.Close();
Response.Write("<Script> alert('Data Exported Succesfully')</Script>");
DropDownList1.SelectedIndex = 0;
}
public void updatestaus(string s)
{
sc.Open();
SqlCommand cmd = new SqlCommand("update BOND_REG set status='P' where fliono ='" + s.ToString() + "'", sc);
cmd.ExecuteNonQuery();
sc.Close();
}
public void fileexport(string l)
{
SqlCommand cmd1 = new SqlCommand("select * from BOND_REG where status='A' and Fliono ='" + l + "'", sc);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd1;
DataTable datatable = new DataTable();
da.Fill(datatable);
ReportDocument crystalReport = new ReportDocument();
crystalReport.Load(Server.MapPath("~/bond.rpt"));
crystalReport.SetDataSource(datatable);
ExportOptions rptExportOption;
DiskFileDestinationOptions rptFileDestOption = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions rptFormatOption = new PdfRtfWordFormatOptions();
string reportFileName = @"C:\Bondreg\" + l + ".pdf";
rptFileDestOption.DiskFileName = reportFileName;
rptExportOption = crystalReport.ExportOptions;
{
rptExportOption.ExportDestinationType = ExportDestinationType.DiskFile;
rptExportOption.ExportFormatType = ExportFormatType.PortableDocFormat;
rptExportOption.ExportDestinationOptions = rptFileDestOption;
rptExportOption.ExportFormatOptions = rptFormatOption;
}
crystalReport.Export();
crystalReport.Close();
crystalReport.Dispose();
Unni R
9-Jun-15 12:04pm
View
like registration form..in this form some date and text fields
Unni R
2-Jun-15 10:42am
View
I need to display this number always SqlDatareader cmd =new SqlDatareader("select max(refno+1) from master"con);
DataSet ds=new DataSet();
cmd.fill(ds);
label.text=ds;
But its not wrking
Unni R
1-Jun-15 1:07am
View
Showing one error message "There is already an open DataReader associated with this Command which must be closed first"
Unni R
27-May-15 0:54am
View
its not working ..showing DD/Jan/YYYY like that
Unni R
26-May-15 18:17pm
View
This field is not a mandatory
Unni R
26-May-15 12:12pm
View
Deleted
Am using calendar control if am not passing any data in this field,in DB it will comes as 01-01-1900..this is my issue.i jst want if am not passing any value it want comes as null
Unni R
26-May-15 12:03pm
View
Deleted
calender control it giving default value like 01-01-1900. i just change the default value as null.
Unni R
26-May-15 12:03pm
View
Deleted
calender control it giving default value like 01-01-1900. i just change the default value as null.
Unni R
30-Apr-15 1:57am
View
Deleted
i am new with SQL server,asp and stored procedure , could you please help me?
protected void Buttonadd_Click(object sender, EventArgs e)
{
if (Session["Data"] == null)
{
C = 1;
dt = new DataTable();
DataRow dr = dt.NewRow();
dt.Columns.Add(new System.Data.DataColumn("EMPNAME", typeof(String)));
dt.Columns.Add(new System.Data.DataColumn("EMPID", typeof(String)));
dt.Columns.Add(new System.Data.DataColumn("DEPARTMENT", typeof(String)));
dr[0] = Txtaddname.Text;
dr[1] = Txtaddempid.Text;
dr[2] = Drpadddept.SelectedItem.Text;
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
Session["Data"] = dt;
}
else
{
C = C + 1;
dt = new DataTable();
dt = (DataTable)Session["Data"];
DataRow dr = dt.NewRow();
dr[0] = Txtaddname.Text;
dr[1] = Txtaddempid.Text;
dr[2] = Drpadddept.SelectedItem.Text;
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
Session.Remove("Data");
Session["Data"] = dt;
this code use to temporally saving data in grid view .
protected void Button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
string strEMPNAME = GridView1.Rows[i].Cells[0].Text.ToString().Trim();
string strEMPID = GridView1.Rows[i].Cells[1].Text.ToString().Trim();
string strDEPARTMENT = GridView1.Rows[i].Cells[2].Text.ToString().Trim();
SqlConnection SC = new SqlConnection("sqlconnection");
SC.Open();
SqlCommand cmd = new SqlCommand("MFIMSSP", SC);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@EMPNAME", txtname.Text);
cmd.Parameters.AddWithValue("@EMPID", txteid.Text);
cmd.Parameters.AddWithValue("@DEPARTMENT", drpdept.SelectedValue);
cmd.Parameters.AddWithValue("@TITLE", Txttitle.Text);
cmd.Parameters.AddWithValue("@CATEGORY", drpcatgry.SelectedValue);
cmd.Parameters.AddWithValue("@OTHERDETAILS", txtothers.Text);
cmd.Parameters.AddWithValue("@PRESENTSITUATION", TxtPresentSituation.Text);
cmd.Parameters.AddWithValue("@IDEA", Txtidea.Text);
cmd.Parameters.AddWithValue("@IMPROVE", Txtimprove.Text);
cmd.Parameters.AddWithValue("@METRICSIMPROVE", drpmatrcs.SelectedValue);
cmd.Parameters.AddWithValue("@EMP_NAME", strEMPNAME);
cmd.Parameters.AddWithValue("@EMP_ID", strEMPID);
cmd.Parameters.AddWithValue("@EMP_DEPARTMENT", strDEPARTMENT);
cmd.ExecuteNonQuery();
Response.Write("<Script> alert('Upadated')</Script>");
txtname.Text = "";
txteid.Text = "";
Txtimprove.Text = "";
Txtidea.Text = "";
TxtPresentSituation.Text = "";
Txttitle.Text = "";
txtothers.Text = "";
drpdept.SelectedIndex = 0;
drpcatgry.SelectedIndex = 0;
drpmatrcs.SelectedIndex = 0;
GridView1.DataSource = null;
GridView1.DataBind();
Session.Clear();
SC.Close();
}
}
this code use to data passing from database .But grid view first row data is saving to database. second row is not saving to database. My stored procedure also attached here.
ALTER procedure [dbo].[MFIMSSP]
@EMPNAME VARCHAR(50),@EMPID VARCHAR(50),@DEPARTMENT VARCHAR(50),
@TITLE VARCHAR(500),@CATEGORY VARCHAR(500),@OTHERDETAILS varchar(500),
@PRESENTSITUATION VARCHAR(500),
@IDEA VARCHAR(500),@IMPROVE VARCHAR(500),@METRICSIMPROVE VARCHAR(500),
@EMP_NAME VARCHAR(50),@EMP_ID VARCHAR(50),@EMP_DEPARTMENT VARCHAR(50)
INSERT INTO MFIMSMASTER1(EMPNAME,EMPID,DEPARTMENT,TITLE ,CATEGORY,OTHERDETAILS,PRESENTSITUATION,
IDEA,IMPROVE,METRICSIMPROVE)VALUES(@EMPNAME,@EMPID,@DEPARTMENT,@TITLE,@CATEGORY,@OTHERDETAILS,@PRESENTSITUATION,@IDEA,
@IMPROVE,@METRICSIMPROVE)
INSERT INTO MFIMSMASTERADDITION(id,emp_name,emp_id,emp_department)VALUES
(SCOPE_IDENTITY(),@EMP_NAME,@EMP_ID,@emp_DEPARTMENT)
end
Unni R
30-Apr-15 1:08am
View
Deleted
protected void Buttonadd_Click(object sender, EventArgs e)
{
if (Session["Data"] == null)
{
C = 1;
dt = new DataTable();
DataRow dr = dt.NewRow();
dt.Columns.Add(new System.Data.DataColumn("EMPNAME", typeof(String)));
dt.Columns.Add(new System.Data.DataColumn("EMPID", typeof(String)));
dt.Columns.Add(new System.Data.DataColumn("DEPARTMENT", typeof(String)));
dr[0] = Txtaddname.Text;
dr[1] = Txtaddempid.Text;
dr[2] = Drpadddept.SelectedItem.Text;
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
Session["Data"] = dt;
}
else
{
C = C + 1;
dt = new DataTable();
dt = (DataTable)Session["Data"];
DataRow dr = dt.NewRow();
dr[0] = Txtaddname.Text;
dr[1] = Txtaddempid.Text;
dr[2] = Drpadddept.SelectedItem.Text;
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
Session.Remove("Data");
Session["Data"] = dt;
this code use to temporally saving data in grid view .
protected void Button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
string strEMPNAME = GridView1.Rows[i].Cells[0].Text.ToString().Trim();
string strEMPID = GridView1.Rows[i].Cells[1].Text.ToString().Trim();
string strDEPARTMENT = GridView1.Rows[i].Cells[2].Text.ToString().Trim();
SqlConnection SC = new SqlConnection("sqlconnection");
SC.Open();
SqlCommand cmd = new SqlCommand("MFIMSSP", SC);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@EMPNAME", txtname.Text);
cmd.Parameters.AddWithValue("@EMPID", txteid.Text);
cmd.Parameters.AddWithValue("@DEPARTMENT", drpdept.SelectedValue);
cmd.Parameters.AddWithValue("@TITLE", Txttitle.Text);
cmd.Parameters.AddWithValue("@CATEGORY", drpcatgry.SelectedValue);
cmd.Parameters.AddWithValue("@OTHERDETAILS", txtothers.Text);
cmd.Parameters.AddWithValue("@PRESENTSITUATION", TxtPresentSituation.Text);
cmd.Parameters.AddWithValue("@IDEA", Txtidea.Text);
cmd.Parameters.AddWithValue("@IMPROVE", Txtimprove.Text);
cmd.Parameters.AddWithValue("@METRICSIMPROVE", drpmatrcs.SelectedValue);
cmd.Parameters.AddWithValue("@EMP_NAME", strEMPNAME);
cmd.Parameters.AddWithValue("@EMP_ID", strEMPID);
cmd.Parameters.AddWithValue("@EMP_DEPARTMENT", strDEPARTMENT);
cmd.ExecuteNonQuery();
Response.Write("<Script> alert('Upadated')</Script>");
txtname.Text = "";
txteid.Text = "";
Txtimprove.Text = "";
Txtidea.Text = "";
TxtPresentSituation.Text = "";
Txttitle.Text = "";
txtothers.Text = "";
drpdept.SelectedIndex = 0;
drpcatgry.SelectedIndex = 0;
drpmatrcs.SelectedIndex = 0;
GridView1.DataSource = null;
GridView1.DataBind();
Session.Clear();
SC.Close();
}
}
this code use to data passing from database .But grid view first row data is saving to database. second row is not saving to database. My stored procedure also attached here.
ALTER procedure [dbo].[MFIMSSP]
@EMPNAME VARCHAR(50),@EMPID VARCHAR(50),@DEPARTMENT VARCHAR(50),
@TITLE VARCHAR(500),@CATEGORY VARCHAR(500),@OTHERDETAILS varchar(500),
@PRESENTSITUATION VARCHAR(500),
@IDEA VARCHAR(500),@IMPROVE VARCHAR(500),@METRICSIMPROVE VARCHAR(500),
@EMP_NAME VARCHAR(50),@EMP_ID VARCHAR(50),@EMP_DEPARTMENT VARCHAR(50)
AS
BEGIN
INSERT INTO MFIMSMASTER1(EMPNAME,EMPID,DEPARTMENT,TITLE ,CATEGORY,OTHERDETAILS,PRESENTS
Unni R
29-Apr-15 8:00am
View
Deleted
Am using sql server 2005 its showing one error message"error message "Msg 156, Level 15, State 1, Procedure EMPSP , Line 8
Incorrect syntax near the keyword 'AS'."
Unni R
29-Apr-15 7:57am
View
Deleted
create procedure EMPSP
@custusename varchar(25),
@custpassword varchar(50),
@custfirstname varchar(25),
@custlastname varchar(25),
@custaddress varchar(100)
as
begin
insert into custlogin(custusename, custpassword)
values ('@custusename','@custpassword')
insert into custinfo(custid, custfirstname, custlastname, custaddress)
values(SCOPE_IDENTITY(), '@custfirstname', '@custlastname', '@custaddress ')
end
error message "Msg 156, Level 15, State 1, Procedure EMPSP , Line 8
Incorrect syntax near the keyword 'AS'."
Unni R
29-Apr-15 7:07am
View
HOW TO INSERT THESE TWO TABLES WITH STORED PROCEDURE
Unni R
28-Apr-15 8:52am
View
Data passing from grid view to database is ok.Now I have one another problem , I have two tables in this application, first table one column value set as primary key and second table one column value set as foreign key. while data inserting time, foreign key column value shows as NULL.My code attached here..
second table code
public void fillgrid()
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
SqlConnection SC = new SqlConnection("sqlconnection");
SC.Open();
SqlCommand cmd = new SqlCommand("insert into MFIMSMASTERADDITION (EMPNAME,EMPID,DEPARTMENT) values('" + GridView1.Rows[i].Cells[0].Text.ToString().Trim() + "','" + GridView1.Rows[i].Cells[1].Text.ToString().Trim() + "','" + GridView1.Rows[i].Cells[2].Text.ToString().Trim() + "')", SC);
cmd.ExecuteNonQuery();
SC.Close();
}
first table code
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection SC = new SqlConnection("sqlconnection");
SC.Open();
SqlCommand cmd = new SqlCommand("INSERTMFIMSMASTERSP", SC);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@EMPNAME", txtname.Text);
cmd.Parameters.AddWithValue("@EMPID", txteid.Text);
cmd.Parameters.AddWithValue("@DEPARTMENT", drpdept.SelectedValue);
cmd.Parameters.AddWithValue("@TITLE", Txttitle.Text);
cmd.Parameters.AddWithValue("@CATEGORY", drpcatgry.SelectedValue);
cmd.Parameters.AddWithValue("@OTHERDETAILS", txtothers.Text);
cmd.Parameters.AddWithValue("@PRESENTSITUATION", TxtPresentSituation.Text);
cmd.Parameters.AddWithValue("@IDEA", Txtidea.Text);
cmd.Parameters.AddWithValue("@IMPROVE", Txtimprove.Text);
cmd.Parameters.AddWithValue("@METRICSIMPROVE", drpmatrcs.SelectedValue);
int m=cmd.ExecuteNonQuery();
if (m > 0)
{
fillgrid();
}
Response.Write("<Script> alert('Upadated')</Script>");
txtname.Text = "";
txteid.Text = "";
Txtimprove.Text = "";
Txtidea.Text = "";
TxtPresentSituation.Text = "";
Txttitle.Text = "";
txtothers.Text = "";
drpdept.SelectedIndex = 0;
drpcatgry.SelectedIndex = 0;
drpmatrcs.SelectedIndex = 0;
GridView1.DataSource = null;
GridView1.DataBind();
Session.Clear();
SC.Close();
}
Unni R
28-Apr-15 6:27am
View
how can i pass this data to database?
Unni R
28-Apr-15 6:27am
View
how can i pass this data to database?
Unni R
25-Apr-15 4:40am
View
Deleted
i have one grid view , 2 text box and and 1 drop down box while entering data's into text box and drop down box it will showing in grid view temporally first data will showing in grid view but we are entering second data .it will overwriting
Unni R
25-Apr-15 4:40am
View
Deleted
i have one grid view , 2 text box and and 1 drop down box while entering data's into text box and drop down box it will showing in grid view temporally first data will showing in grid view but we are entering second data .it will overwriting
Unni R
20-Apr-15 5:35am
View
Thanku .. its working
Unni R
20-Apr-15 5:24am
View
error mesage "Msg 243, Level 16, State 1, Line 2
Type Date is not a defined system type.
Msg 243, Level 16, State 1, Line 2
Type Date is not a defined system type."
Unni R
20-Apr-15 5:18am
View
I have one table its contain 3 columns name ,dep and dob . dob data type as "datetime".
select * from empmaster WHERE DOB=getdate().. its not working
Show More