15,899,679 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 Python 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 Abdul Samad KP (Top 78 by date)
Abdul Samad KP
19-Jun-16 7:32am
View
In the dropdown 'G' is capital letter <asp:ListItem Text="Gas" Value="Gas">
and you are comparing it with "gas", which will never return true
Abdul Samad KP
12-Oct-15 8:58am
View
remove 'SET @DCNo ='+Cast(@dc as VARCHAR)+';
and change
from Vw_InOutWard where DCNo=@dc) src
to
from Vw_InOutWard where DCNo=''' + @dc + ''') src
Beware of SQL injection, sanitise your textbox text before passing to the SP
Abdul Samad KP
12-Oct-15 7:45am
View
Pls post full code
Abdul Samad KP
12-Oct-15 7:45am
View
Deleted
Pls post full code
Abdul Samad KP
12-Oct-15 4:22am
View
You need to pass the @DCNo from frontend, ie your textbox value, and if it is not a integer then change set @query = 'DECLARE @DCNo INT;
to set @query = 'DECLARE @DCNo varchar;
By the way I assume , you put all this query in a stored procedure
Abdul Samad KP
8-Oct-15 9:40am
View
You need to convert it to string
((CheckBox)dg.Controls[i]).Checked.ToString();
this will work.
You don't need a conditional operator (?:) operator because ((CheckBox)dg.Controls[i]).Checked return true or false only.
Abdul Samad KP
8-Oct-15 8:03am
View
use Controls[i] instead of Controls(i)
Abdul Samad KP
2-Oct-15 9:58am
View
How many items did you select? If you want to select multiple items press and hold control key then select items.
Abdul Samad KP
30-Sep-15 2:51am
View
If you use dropdownlist then you can select only one item at a time. If you want to select multiple items then use listbox , so that the user can hold control key and select multiple items. Alternatively you can use CheckedListBox also
Abdul Samad KP
27-Sep-15 7:30am
View
Deleted
I think the problem is here
blist.Items.Add(imgList.Images(0))
You are always adding first image from the list.
Abdul Samad KP
24-Sep-15 17:29pm
View
Set the windowState property of the form to maximized
remove your code and add below code in form load
this.WindowState=FormWindowState.Maximized;
Abdul Samad KP
21-Sep-15 9:49am
View
I see two problems in your code
1. Rows[14] , 14 is your column number, not the row index
2. You have declared array of size 0
change
byte[] mydata = new byte[0];
mydata = (byte[])(this.abaanaDataSet.abaanaCC.Rows[14]["CCImage"]);
to
byte[] mydata = (byte[])(this.abaanaDataSet.abaanaCC.Rows[0]["CCImage]);
I assume you have CCImage is not null in row 1
Abdul Samad KP
11-Sep-15 17:03pm
View
If you want to pass 10 parameters , you have to add all of them to the list
Abdul Samad KP
4-Sep-15 19:23pm
View
You are right , since the controls are generated at runtime , you have to place your code outside the if(!IsPoastBack) block, but in that case your code should work properly.
So I am deleting my answer.
I guess the code you have posted is not the original one, because there are many errors in that.
Abdul Samad KP
4-Sep-15 6:26am
View
When uploading you have to insert id to all rows, don't leave it blank. If you want to select the records like excel you can use
SELECT CASE WHEN Row_Number() OVER(ORDER BY ID) =1 THEN ID ELSE '' END AS [ID],Val1,val2,val3,val4,val5,val6,val7
FROM YourTable WHERE ID=@SearchingID
Abdul Samad KP
4-Sep-15 6:09am
View
I think, this is not the right way to do it. You have to repeat the ID in all records belongs to it
Abdul Samad KP
4-Sep-15 6:05am
View
Pls post your treeview binding code and code in the page load event
Abdul Samad KP
4-Sep-15 5:59am
View
What is the ID of other tree rows?
Abdul Samad KP
4-Sep-15 5:50am
View
Page load event is fired when a post back occurs, so pls check you have placed your treeview binding code inside a if(!IsPostback) checking
Abdul Samad KP
4-Sep-15 5:42am
View
When are you binding the tree?
Inside page load?
Abdul Samad KP
4-Sep-15 5:34am
View
You can use a gridview inside your gridview and bind the child gridview on databind event of the parent grid, or you can use a datarpeater control
Abdul Samad KP
4-Sep-15 5:24am
View
Why are you binding tree view in Selected node changed event?
Because of this, the selection is resting, that is why you are always getting first node.
By the way , why are you assigning a text to a tree node?
Abdul Samad KP
5-May-15 3:06am
View
Always use SQL parameters in your command instead of appending command with the values.
Here the problem is date format.
If you systems are using English culture then you can try
string s=" insert into payment (paid_date) values('"+h1.ToString("dd/MMM/yyyy") +"')";
Abdul Samad KP
4-May-15 11:50am
View
What dates you expect if you select May/2015 and week 1?
Abdul Samad KP
3-May-15 3:19am
View
How are you binding your grids, from a data table? What is the relationship between the grids?
Abdul Samad KP
3-May-15 3:02am
View
after I edit solution1, it was not displaying so I added it again, but now it is coming twice
Abdul Samad KP
30-Apr-15 11:27am
View
I think there is a mistake in your code for reading the text file
change
if (System.IO.File.Exists(lstImages.SelectedItem.ToString()))
to
if (System.IO.File.Exists(myFile))
Abdul Samad KP
30-Apr-15 11:15am
View
The code you have posted is not delete code, it is just changing the visibility of the button and setting the command argument etc, I assume this is the code you are using in item data bound event of a gird. Please post the code in the Item Command event
Abdul Samad KP
30-Apr-15 11:08am
View
As Karthik said , it is just checking any rows are there in the table. There is nothing to do with null , you can use like IF EXISTS(select top 1 1 from table) also
Abdul Samad KP
28-Apr-15 8:08am
View
Your signup page is in a separate folder or in the main folder?
Can u please explain your folder structure
Abdul Samad KP
28-Apr-15 2:33am
View
Deleted
remove location path="" and try like this
<location path="Signup">
<system.web>
<authorization>
<allow users="*">
<system.web>
<httpruntime targetframework="4.5">
<compilation debug="true" targetframework="4.5">
<authentication mode="Forms">
<forms loginUrl="Login.aspx" timeout="2880" />
<authorization>
<deny users="?">
<system.web>
Abdul Samad KP
28-Apr-15 2:32am
View
Deleted
remove location=""
try like this
<location path="Signup">
<system.web>
<authorization>
<allow users="*">
<system.web>
<httpruntime targetframework="4.5">
<compilation debug="true" targetframework="4.5">
<authentication mode="Forms">
<forms loginUrl="Login.aspx" timeout="2880" />
<authorization>
<deny users="?">
<system.web>
Abdul Samad KP
13-Apr-15 11:16am
View
Why you are saving date as string in the DB?
Any way you can use DateTime.ParseExact to convert string to date
Have a look at https://msdn.microsoft.com/en-us/library/w2sa9yss(v=vs.110).aspx
Abdul Samad KP
13-Apr-15 11:01am
View
It will work only in windows forms. In webforms, if you change item from your code , it will not fire the event, move your code in the selected item changed event to a separate method and call it wherever you need.
Abdul Samad KP
7-Apr-15 7:24am
View
Is your data coming from database?
Abdul Samad KP
1-Dec-14 9:58am
View
I think you are doing it wrong way, Instead of changing the read only property in the check box checked changed event, you can add edit item templates and make the row editable by setting grid view edit item index to that row
Abdul Samad KP
27-Oct-14 2:12am
View
Check whether cookies are disabled in IE
Abdul Samad KP
24-Oct-14 8:02am
View
In the SQL, NULL is treated as special types, so MT. TranStatus <> 'Cancel' will not include rows where MT. TranStatus is null.
To get your desired output, you can use ISNULL (MT. TranStatus,'') <> 'Cancel'
Abdul Samad KP
1-Oct-14 10:41am
View
Since you are not changing your command text, you will have same data and schema in all tables
Abdul Samad KP
30-Sep-14 7:33am
View
Assign DataPropertyName for all datagrid columns (you can do it in the designer)
It is better to create the datattable with your datagridview structure(columns) in the page load and bind it to the grid, so that you can easily handle the grid
Abdul Samad KP
30-Sep-14 6:12am
View
Set
datagridview1.AutoGenerateColumns=false;
Abdul Samad KP
30-Sep-14 4:57am
View
Just reverse the process
1. Declare the dataset
2. Read xml (ds.ReadXml("your xml filepath", XmlReadMode.ReadSchema);)
3. Get dgvDataTable from the ds and bind to grid
(If you have given a name to the datattable while declaring it(before saving) then you can get it by name like ds.Tables["dgvDataTable "]; or you can use index)
4. Get txtDataTable from the ds
5. Get textbox value from the txtDataTable
If you have marked "# of columns" as primary key then you can find the row by txtDataTable.Rows.Find(<column number="">)(this will return datarow) else you can use txtDataTable.Select("[# of columns]=<column number="">") (this will return datarow array)
6. Assign values to textbox
Abdul Samad KP
30-Sep-14 1:30am
View
Why you are filling dataset multiple times?
Abdul Samad KP
29-Sep-14 11:47am
View
How you are binding your DataGrid?
If you are binding from datatable try this
ds.Tables.Add((DataTable)DataGridview1.DataSource);
Abdul Samad KP
25-Sep-14 7:57am
View
What you mean by display, as far as I know datatable is not a control and it cannot be used to display anything but bound to other controls to dispalay its contents.
Abdul Samad KP
24-Sep-14 3:04am
View
Why you want that? use AutoScroll=True
Abdul Samad KP
24-Sep-14 1:33am
View
No, you may need to copy the aspnet_client folder into your application folder
Abdul Samad KP
23-Sep-14 9:05am
View
As Wes Aday said , @val is dbnull. To avoid this error use .ToString()
Cmd.ExecuteNonQuery()
TxtValue.Text = Cmd.Parameters("@val").Value.ToString()
Abdul Samad KP
23-Sep-14 1:22am
View
What is dr.Close();
Where you are declaring your command and connection?
Have you initialized them?
Abdul Samad KP
23-Sep-14 1:21am
View
Deleted
Are you getting any error message?
Abdul Samad KP
22-Sep-14 4:02am
View
You mean Global.asax ?
Abdul Samad KP
20-Sep-14 9:08am
View
Design a page with a dropdown and a textbox or html editor control and a save button. Load all the template types (various stages) to dropdown list, so the user can select the template type and enter the templates with predefined tags and save it.
Then in your class, before sending email load the template and replace the tags.
Abdul Samad KP
20-Sep-14 8:38am
View
Check all your where clauses
You must be missing =@Px in one of your where clause
Abdul Samad KP
19-Sep-14 17:23pm
View
Have you assigned a connection to the command?
like
cmd.Connection=yourconnection
Abdul Samad KP
19-Sep-14 17:18pm
View
Sorry I don’t have a sql2012 installed on my machine to test, but I think it will work if the time format is hh:mm:ss or hh:mm. Please check all rows are having values in this format.
Abdul Samad KP
19-Sep-14 16:42pm
View
"Insert into EmployeeMaster(Emp_EmployeeNumber,Emp_Surname,Emp_FirstName,Emp_OtherNames,Emp_TitleEmp_Gender,Emp_OfficePhoneExtension,Emp_YearsInService,Emp_DefaultHours,Emp_Status,Emp_DepartmentCode,Emp_DivisionCode,Emp_SectionCode,Emp_BranchCode,Emp_RegionCode,Emp_LocationCode,Emp_ReportTo,Emp_JobCode,Emp_ClassCode,Emp_PositionCode,Emp_Group1Code,Emp_Group2Code,Emp_Group3Code,Emp_EmploymentDate,Emp_EffectiveDate,Emp_EmploymentType,Emp_ReasonForChange,Emp_LastChangedBy,Emp_DateofChange,Emp_AlternateNumber1,Emp_PayPending) " & _
"Select @py ,Emp_EmployeeNumber,Emp_Surname,Emp_FirstName,Emp_OtherNames,Emp_TitleEmp_Gender,Emp_OfficePhoneExtension,Emp_YearsInService,Emp_DefaultHours,Emp_Status,Emp_DepartmentCode,Emp_DivisionCode,Emp_SectionCode,Emp_BranchCode,Emp_RegionCode,Emp_LocationCode,Emp_ReportTo,Emp_JobCode,Emp_ClassCode,Emp_PositionCode,Emp_Group1Code,Emp_Group2Code,Emp_Group3Code,Emp_EmploymentDate,Emp_EffectiveDate,Emp_EmploymentType,Emp_ReasonForChange,Emp_LastChangedBy,Emp_DateofChange,Emp_AlternateNumber1,Emp_PayPending EmployeeMaster where Emp_EmployeeNumber= @px " & _
"update employeeBenefits set EmployeeNo=@py where EmployeeNo=@px; " & _
"update EmployeeCareerHist set ECareer_EmployeeNumber=@py where ECareer_EmployeeNumber=@px; " & _
'' add remaining update statements here, sperate each statement with a semi column(;)
Abdul Samad KP
19-Sep-14 16:20pm
View
Deleted
For this you can use UPDATE CASCADE in the foreign key, then if you update the primary key all foreign keys will update automatically.
If you still want to do it in the way you have mentioned then please show me your query string, I can’t see the code in your comments
Abdul Samad KP
19-Sep-14 15:54pm
View
Change cellValue[j, k] = exlWs.Cells[j+1,k+1].ToString();
to cellValue[j, k] = exlWs.Cells[j+1,k+1].Value.ToString();
Abdul Samad KP
19-Sep-14 14:39pm
View
Can you post your code?
Abdul Samad KP
18-Sep-14 8:00am
View
If it is in a common portal, you can check the Url in Application_BeginRequest event of global.asax and redirect them
Abdul Samad KP
18-Sep-14 7:51am
View
I used to get this error in VS2008 (now I am using VS2010), if I open too many forms in the VS designer
Abdul Samad KP
18-Sep-14 2:11am
View
You have to add parameters one by one
Abdul Samad KP
15-Sep-14 1:41am
View
Did you try
window.opener.location.href = window.opener.location.href;
this is working for me
Abdul Samad KP
15-Sep-14 1:27am
View
Did you try
INSERT INTO TW100NEL(ComponentNumber,ObjectDescription,Group,Quantity,Unit) VALUES(?,?,?,?,?)
Abdul Samad KP
14-Sep-14 1:43am
View
As George Jonsson said there is no calendar column for Datagrid view, if you are using a custom datetime picker control, you can set MinDate.
Abdul Samad KP
12-Sep-14 19:03pm
View
If you want to provide user role based access then this will work, I have used this in a couple of projects, but I haven't used membership provider. There is no connection between application size and this. The only thing is, you have to override all methods as per your requirements
Abdul Samad KP
11-Sep-14 8:27am
View
How you are binding your grid?
Abdul Samad KP
11-Sep-14 4:50am
View
Sorry for that, I have deleted the comment,
So basically you want property like 'AutoCompleteCustomeSource' of textbox control, I think you can create a custom control for this
Have look at this, http://msdn.microsoft.com/en-us/library/7tas5c80(v=vs.110).aspx
http://msdn.microsoft.com/en-us/library/7tas5c80(v=vs.110).aspx
Abdul Samad KP
11-Sep-14 1:44am
View
Change the line Dim da As New SqlCeDataAdapter(query, conn)
to Dim da As New SqlCeDataAdapter(bcmd, conn)
Abdul Samad KP
11-Sep-14 1:33am
View
Deleted
You can use Ajax Extender
Abdul Samad KP
11-Sep-14 1:27am
View
I think you can use 'Attach To Process' option available under VS tools menu
Abdul Samad KP
10-Sep-14 5:58am
View
You have to add a space after the keyword INNER JOIN and also before the key word FROM
For example change the line "RA ON Courier.CourierID = RA.CourCompany INNER JOIN" & _
to "RA ON Courier.CourierID = RA.CourCompany INNER JOIN " & _
Abdul Samad KP
10-Sep-14 5:53am
View
Deleted
You have to add a space after the keyword INNER JOIN and also before the key word FROM
For example change the line "RA ON Courier.CourierID = RA.CourCompany INNER JOIN" & _
to "RA ON Courier.CourierID = RA.CourCompany INNER JOIN " & _
Abdul Samad KP
10-Sep-14 5:50am
View
Sorry, I didn't get
What did you mean by dynamic?
Abdul Samad KP
10-Sep-14 1:23am
View
The SQL Syntax is correct, what error message you are getting?
Abdul Samad KP
9-Sep-14 2:58am
View
What exactly you want to do? Can you please explain in detail?
Abdul Samad KP
9-Sep-14 2:11am
View
Sorry, I guess I did not understand your question correctly,
You want to add files to the visual studio project, or you are looking for the code to transfer files?
Abdul Samad KP
9-Sep-14 2:03am
View
How you are inserting updated values into the log table?
I mean, if the user is updating multiple records at the same time, then the trigger will be executed only once and all the new records will be there in the inserted table. So your insert query should insert all records available in the Inserted table.
This is important if you are processing (like inner joining with some other tables or getting value into parameters and doing some calculation or checking some conditions) the records in the Inserted table before inserting into the log table
Show More