Click here to Skip to main content

Comments by S. M. Ahasan Habib (Top 112 by date)

S. M. Ahasan Habib at 30-Dec-13 3:37am View
   
in your code i see from address is
Msg.From = new MailAddress(txtEmail.Text);
here you can change or update and set what email you can use
S. M. Ahasan Habib at 29-Dec-13 16:30pm View
   
you are most welcome
S. M. Ahasan Habib at 21-Dec-13 10:44am View
   
Reason for my vote of 5 \n Nice!
S. M. Ahasan Habib at 21-Dec-13 5:19am View
   
ok then try with this code and guide which i said above and let me know if it not solve your problem.
S. M. Ahasan Habib at 21-Dec-13 5:17am View
   
you are most welcome!
S. M. Ahasan Habib at 20-Dec-13 16:18pm View
   
create proc GetBooks(@SId int)
as
begin
SELECT
L.LId
,L.SId
,S.SName
,L.BId
,B.BName
,L.Land_Time
FROM Lend_Details L
INNER JOIN Student_Details S ON S.SId = L.SId
INNER JOIN Book_Details B ON B.BId = L.BId
WHERE L.SId = @SId;
end
S. M. Ahasan Habib at 20-Dec-13 11:12am View
   
yes! just added some description and inner word which is little readable. Though the guy said he is new in sql so i think readability might help and he might not confuse with inner/left/right join.
S. M. Ahasan Habib at 12-Dec-13 4:13am View
   
Reason for my vote of 5 \n Nice tip!
S. M. Ahasan Habib at 25-Nov-13 4:03am View
   
You need to follow some steps to create mock object
step1> Download rahno mock dll from the above link (which i provide in solution section)
step2> Add that Rhino.Mocks.dll to your .net test project
step3> where you need to create mock object you use GenereteStub method of MockRepository class. It will create mock object for you.
step4> Inject that mock object to your test class.

 
The article may help you
http://www.codeproject.com/Articles/686935/Unit-testing-with-Mock-objects-Rhino-Mocks
S. M. Ahasan Habib at 24-Nov-13 20:32pm View
   
thanks!
S. M. Ahasan Habib at 23-Nov-13 23:04pm View
   
thanks! i update my solution.
S. M. Ahasan Habib at 23-Nov-13 22:46pm View
   
thanks
S. M. Ahasan Habib at 6-Nov-13 2:46am View
   
It might be user browser setting issue. So i suggest to request client to check his browser setting regarding popup display.
S. M. Ahasan Habib at 6-Nov-13 0:22am View
   
Reason for my vote of 5 \n Thanks for sharing!
S. M. Ahasan Habib at 4-Nov-13 10:50am View
   
thanks!
S. M. Ahasan Habib at 4-Nov-13 5:30am View
   
Please provide structured xml with sample 1 or 2 data. suppose 12. It will help audience to understand your xml data structure and answer your question more easily. No need to show huge data as a part of question. Remember that in xml data/schema structure is important for programming. data is not important for solve problem. It is client asset.
S. M. Ahasan Habib at 4-Nov-13 5:25am View
   
dynamic sql context is different. If you check the following code
declare @sql nvarchar(max) = 'create table #MyTable(id int);insert #MyTable(id) values(1);select * from #MyTable;';
exec sp_executesql @SQL;
 
You will see that it is working and everytime it is created #MyTable temporary table. If its connection was same then it would throw exception like #MyTable is already exists. But in above case it is not throwing any exception(i am not droping that #MyTable).
Another finding is if you run the following code
declare @sql nvarchar(max) = 'create table #MyTable(id int);insert #MyTable(id) values(1);select * from #MyTable;';
exec sp_executesql @SQL;
select * from #MyTable;
then you will find a exception from the last line of the tsql code. "#MyTable not exists". That means dynamic sql execution context and current context are not same.
S. M. Ahasan Habib at 4-Nov-13 4:04am View
   
Yes it is possible but that type of huge triggers management might be difficult and create maintenance overhead. My suggestion is try to do it from your application logic/business logic layer with proper object oriented programming. It will help you to keep simple to your databases.
S. M. Ahasan Habib at 3-Nov-13 22:02pm View
   
Reason for my vote of 5 \n Nicely explain!
S. M. Ahasan Habib at 1-Nov-13 4:28am View
   
asp.net is web development platform. c sharpt is a programming language. the full form of asp is Active Server Page. Before .net comes Asp was the microsoft web development platform. Now it is asp.net. You can create Page, HttpHandler, HttpModule etc are the part of the asp.net web platform. When you use/develop/create that items you need to use programming language. Besides web development, you can use c# for windows/wpf development also.
S. M. Ahasan Habib at 31-Oct-13 11:50am View
   
Reason for my vote of 5 \n Nicely explain
S. M. Ahasan Habib at 30-Oct-13 6:28am View
   
Reason for my vote of 5 \n thanks for your tips. If you describe what type of problem you solved with implementing this interface will be helpful.
S. M. Ahasan Habib at 30-Oct-13 6:21am View
   
I copy your markup and added it to my solution and found it is working as you expect(after enter email to the first textbox it will postback to the server). Only that thing is different from my code.
Your mark-up top line is
<%@ Page Language="C#" AutoEventWireup="True" Inherits="SubmitPage" Codebehind="SubmitPage.aspx.cs" %>
in my case it is
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
In my test project it is .NET framework 4.5 with visual studio 2012.
I request you to check the Inherits property to your markup top line. It must be same as your code behind class name (namespace.classname is actual format).
Another thing you can do
Just remove all code and add a single textbox there and check it is working or not. If works then add more control and check. Better you create another aspx page and do rnd there with that way. Hope you can solve the problem. Just be confident that code is fine(your code is working in my side).
S. M. Ahasan Habib at 29-Oct-13 22:54pm View
   
Please show your mark-up code. Also need to know any client side validation logic exists which prevent form being post back to server.
S. M. Ahasan Habib at 29-Oct-13 8:12am View
   
Sorry for not clear. if you build that project, you will find exe(ex a.exe) file (suppose you create a console app). So then you go that file location(ex d:\projects\a.exe) and double click on that for executing. Let me know still you are confused.
S. M. Ahasan Habib at 28-Oct-13 22:22pm View
   
Run sql server profiler and see what sql execute to the database. Peek that sql from profiler and open that to management studio. Analyze and test that sql. Hopefully you will identify your problem.
S. M. Ahasan Habib at 28-Oct-13 12:57pm View
   
what type of error you found. Is it compile time or run time? Please write detail about errors. for example if it is compile time then what compiler says. if it is run time then what exception it throws and exception message etc.
S. M. Ahasan Habib at 28-Oct-13 7:40am View
   
Let me know if any issue you face.
S. M. Ahasan Habib at 27-Oct-13 12:19pm View
   
Please write your mail address here. I will send my project.
S. M. Ahasan Habib at 27-Oct-13 11:40am View
   
I agree that auto increment number should be generated from database either auto identity or sequence number or auto generated guid. Otherwise concurrency issue might be there. Here just i implement the solution that ask for(based on datetime and new number sequence).
S. M. Ahasan Habib at 26-Oct-13 15:04pm View
   
what type of error you are finding. Error detail information need to show here.
S. M. Ahasan Habib at 26-Oct-13 0:42am View
   
Reason for my vote of 5 \n Nice work!
S. M. Ahasan Habib at 25-Oct-13 12:48pm View
   
Deleted
Tadit: Thanks for your post. Tried your code, but always get the value of the imageBtn.ID as 5 since I have total 6 there (counting started from 0). Please advise how to get the right one. Thanks again.
S. M. Ahasan Habib at 24-Oct-13 2:48am View
   
thanks
S. M. Ahasan Habib at 23-Oct-13 8:50am View
   
i tried with this and it is working for me!
my database part:
--my table
create table MyTestTable(Id uniqueidentifier, Name varchar(50));
go
--my sp
create proc testsp
(
@id uniqueidentifier
,@Name varchar(50)
)
as
begin
insert into MyTestTable(Id, Name) values(@Id, @Name);
end
go
 
and my application code
 
string spName = "testsp";
var _ID = Guid.NewGuid();
SqlParameter[] spParams = new SqlParameter[2];
spParams[0] = new SqlParameter("Id", _ID);
spParams[1] = new SqlParameter("Name", "A");
var connString = ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString;
 
using (var conn = new SqlConnection(connString))
{
conn.Open();
using (SqlCommand cmd = conn.CreateCommand())
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = spName;
cmd.Parameters.AddRange(spParams);
cmd.ExecuteNonQuery();
}
}
I used raw ado.net and it is working for me. I do not know about your SqlHelper class and its method ExecuteDataset. If anyway you can not find any solution you use raw ado.net code in that area only just like i show it here.
S. M. Ahasan Habib at 7-Oct-13 13:46pm View
   
web.config/app.config keys are case sensitive. Please check that. Other then that you should retrive config value with the above sample code.
S. M. Ahasan Habib at 1-Apr-13 12:46pm View
   
Sorry no idea about Visual Foxpro.
S. M. Ahasan Habib at 1-Apr-13 6:07am View
   
you can change in powershell connection string and run it from your local. It will fetch data from remote database server based on your connection string and store it to your local pc. You just go the link above create a powsershell script (.ps1 extention) and dump that code to your file and update with your connection string. Then go to windows powershell tool, execute that see the result. As simple as that. I think you will impress with power shell power.
S. M. Ahasan Habib at 31-Mar-13 1:39am View
   
You should bind ddlCity in ddlState selected index changed event not page load event. Now from the save button click event you set break point to ddlState.SelectedValue and ddlCity.SelectedValue and see its value as the expected value found there or not.
S. M. Ahasan Habib at 30-Mar-13 14:13pm View
   
Show you code where you handle selected index change event, where you handle page load event and save event. Need to see where you bind your ddlState dropdown. My guess is when you press save button at the moment ddlState dropdown may be rebind if you not use page.IsPostBack property.
S. M. Ahasan Habib at 30-Mar-13 8:58am View
   
If it is sqlserver expressed then you just first login it with management studio with windows authentication then you can active sa (system administrator) user and set its password or you can create another user(login,user) then set it to crystal report
S. M. Ahasan Habib at 30-Mar-13 4:41am View
   
No way you can access client file system. What it you can do is, then it will automatically saved download folder without asking client to give location.
S. M. Ahasan Habib at 30-Mar-13 2:17am View
   
Based on both record set what will be the final result set? Based on what criteria you want that? Please clarify that. Without that your question will be unclear to us.
S. M. Ahasan Habib at 28-Mar-13 23:59pm View
   
Sorry! I have no example in my hand at the moment. How to use progress bar i find a url
http://www.dotnetperls.com/progressbar
Just remember that database stored procedure execution is time is no deterministic and when it will finish you did not know. So you can not set any perfect progress bar end result. You need to use trick here.
S. M. Ahasan Habib at 22-Mar-13 22:15pm View
   
Seems you write the serverside method in the Masterpage. You must write it to Page codebehind. Event if you write that webmethod to the user control then it will not work. So you just create a page, then take ScriptMangager referenece to that page(either you do not take reference it from masterpage) then call webmethod which is written in that page code behind.
S. M. Ahasan Habib at 20-Mar-13 6:17am View
   
You set full permissions to Everyone(default user/group) at your directory and check it is working or not.
S. M. Ahasan Habib at 20-Mar-13 3:59am View
   
You need to show your 2 drop down's html markup and page_init/load event where you bind/populate your dropdown controls and how will you handle selectedIndexChanged event.
S. M. Ahasan Habib at 19-Mar-13 2:12am View
   
I guess you have multiple sql server instance installed in your pc. you can check it to go to windows services viewer and see how many sql server services found there. You can get specific instance from your code and management studio and then execute the query. The query will return database names from that particular instance. I guess you are facing the problem is create database is one instance and connect to other instance and search that database.
S. M. Ahasan Habib at 17-Mar-13 11:28am View
   
you execute SELECT * FROM sys.Databases query from your sql server management studio and see the results. If there you do not find your database name then let me know.
S. M. Ahasan Habib at 17-Mar-13 8:44am View
   
this is product number
S. M. Ahasan Habib at 16-Mar-13 13:56pm View
   
which line of code you got this error? I need to address the actual statement where it throws.
Please visit the link. It will help you
http://stackoverflow.com/questions/2011214/problem-to-convert-byte-array-to-double
S. M. Ahasan Habib at 16-Mar-13 13:05pm View
   
Thanks. If solution will help to solve your problem then you accept it as answer.
S. M. Ahasan Habib at 16-Mar-13 8:50am View
   
DGv_session object structure create little confusion to me. Instead of assign value to existing session grid view DGv_session. I suggest you create a new DataTable inside the loop and store that session if you need letter on and assign that to any gridview for display purpose.
S. M. Ahasan Habib at 16-Mar-13 8:22am View
   
yes you can use .cs files methods. please visit the link for example
http://unboxedsolutions.com/sean/archive/2005/11/05/787.aspx
S. M. Ahasan Habib at 14-Mar-13 12:57pm View
   
no matter where database stored where c: or d: or other drive. Application just connect to its database and execute its query. Database files(MDF,LDF) is hidden from application. So no problem will raise for that.
S. M. Ahasan Habib at 8-Mar-13 1:34am View
   
You can store user specific data to your database and user wise fetch that data and set it to the textbox. If your datasource has non user specific data then you need to transform it to your business layer and display it to the page text box.
S. M. Ahasan Habib at 5-Mar-13 22:28pm View
   
Please showup your code though we can clearly understand your problem.
S. M. Ahasan Habib at 1-Mar-13 3:22am View
   
You just start study on that then in web you can find so many code sample. You can start from the following link.
http://www.codeproject.com/Articles/17203/Using-jQuery-for-AJAX-in-ASP-NET
S. M. Ahasan Habib at 1-Mar-13 1:36am View
   
Please visit the link
http://stackoverflow.com/questions/2965837/insert-statement-conflicted-with-the-foreign-key-constraint
S. M. Ahasan Habib at 1-Mar-13 1:26am View
   
Actually it is data relation establishment problem(database issue, your application code is ok). You just execute sp from your sql server management studio with parameters which you passed from your web application and easily address/solve the problem. You can find the parameters value easily if you run sqlserver profiler and track the spcalling from web application.
S. M. Ahasan Habib at 1-Mar-13 1:14am View
   
Waiting for your feedback.
S. M. Ahasan Habib at 1-Mar-13 1:06am View
   
Actually i show up an example. You can change it and execute it with stored procedure the code like
string spName = "usp_InsertMyTable";
var cmd1 = new SqlCommand(spName , conn);
cmd1.CommandType = CommandType.StoredProcedure;
//Add paraters to the cmd1 command
cmd1.ExecuteNonQuery().
S. M. Ahasan Habib at 1-Mar-13 0:49am View
   
welcome
S. M. Ahasan Habib at 1-Mar-13 0:48am View
   
Plese show your code though we can understand your problem better.
S. M. Ahasan Habib at 28-Feb-13 6:22am View
   
http://www.codeproject.com/Articles/476967/WhatplusisplusViewData-2cplusViewBagplusandplusTem
S. M. Ahasan Habib at 27-Feb-13 23:37pm View
   
Instead of button click event you can do it Form_Load event.
S. M. Ahasan Habib at 27-Feb-13 3:18am View
   
One very good link added to the solution. Please check and hope it will help you more.
S. M. Ahasan Habib at 27-Feb-13 3:16am View
   
you can execute "GRANT select ON myTB TO user2" query from your sqlserver management studio. After that your application can access that table. Again that type of permission query, better you can execute inside database(enterprize manager) context.
S. M. Ahasan Habib at 27-Feb-13 3:14am View
   
If you write business logic inside controller action then no body can protect you, in that case you can call action testing as functional testing, but it will violated of mvc design pattern principle. So functionality should be inside Model/Business component and Model test will be called functional testing. (again my personal opinion)
S. M. Ahasan Habib at 27-Feb-13 1:38am View
   
You just logged in user2 instead of user1 and execute that query.
S. M. Ahasan Habib at 26-Feb-13 23:37pm View
   
Yes. You can check with
declare @dt datetime = '01-Jan-2013';
select (DateAdd(mm,-1,@dt))
You can use the filter like
select day(DateAdd(mm,-1,getdate())), month(DateAdd(mm,-1,getdate())), year(DateAdd(mm,-1,getdate()))
S. M. Ahasan Habib at 26-Feb-13 3:22am View
   
Please show your webmethod code and exception line where null reference exception raised. You can easily debug that code and identify that area.
S. M. Ahasan Habib at 25-Feb-13 5:29am View
   
Please use the following code and try once again.
System.Net.ServicePointManager.ServerCertificateValidationCallback = (s, certificate, chain, sslPolicyErrors) => true;
S. M. Ahasan Habib at 25-Feb-13 2:14am View
   
Please check your smtp server from where mail will send and check the ssl port you are using to send mail. It is better to take any Network guy who can understand the ssl port/configuration issue of smtp server. Though you are not past your code, I hope your code is ok.
S. M. Ahasan Habib at 25-Feb-13 0:11am View
   
wecome:)
S. M. Ahasan Habib at 24-Feb-13 1:41am View
   
Open sql server enterprise manager and add/select windows user and give permission for that user to appropriate database user, user objects like(table, view, stored procedure) with appropriated permission like create/read/delete/drop/execute etc.
S. M. Ahasan Habib at 24-Feb-13 0:58am View
   
Please upload your markup code. When you bind your grid with data source then do you conditionlly bind that like If Page.IsPostBack?
S. M. Ahasan Habib at 24-Feb-13 0:26am View
   
Please show the exception lines and message though i can address the problem.
S. M. Ahasan Habib at 23-Feb-13 10:17am View
   
If you not sure which version webservice used then go trial and error basis. First go with 1.1 version from your client config file, if not working then go 1.2 version.
S. M. Ahasan Habib at 22-Feb-13 4:48am View
   
you are most welcome.
S. M. Ahasan Habib at 22-Feb-13 4:15am View
   
one minor bug was there. tabIndex datatype was string. When use tabIndex + 1 it actually concate 2 strings. I update that with parseInt(tabIndex) + 1 and fix the issue. Just one thing remember that when you assign tabIndex you start from 1 and it should be cronological order. Like 1, 2, 3 etc. In your code i see 1,2,4. You just change that and rerun your code.
S. M. Ahasan Habib at 22-Feb-13 0:54am View
   
One thing i corrected that is (typeo) evt instead of event. Now try again. Just make sure that markup(html) attribute is you assigned. What type of error you found?First check it to firefox. Then go for other browser as well.
S. M. Ahasan Habib at 22-Feb-13 0:52am View
   
Pls check it again, I update the code and test it and found it is working.
BEGIN
DECLARE @CAMP VARCHAR(2)
DECLARE @TYPE VARCHAR(10)
SET @TYPE='sdfas';
SET @CAMP='asdfasd'
DECLARE @QRY NVARCHAR(300)
SET @QRY='SELECT * FROM [dbo].[Target] WHERE (1=1)';
IF(@CAMP<>'')
BEGIN
SET @QRY=@QRY+' AND FirstName='''+@CAMP + '''';
END
IF(@TYPE<>'')
BEGIN
SET @QRY=@QRY + ' AND LastName= '''+@TYPE + '''';
END
EXEC SP_ExecuteSql @QRY;
END
S. M. Ahasan Habib at 21-Feb-13 9:27am View
   
I provided solution for that problem too. Please visit that link which you mention above and make sure it will work for you.
S. M. Ahasan Habib at 21-Feb-13 9:20am View
   
provide links inside solution. Please read it again.
S. M. Ahasan Habib at 21-Feb-13 2:59am View
   
yes one typeo is there evt will be there instead of event. I update your question. Please read it again and execute it firebox now and see the result. I tested it in firefox and found that it is working.
S. M. Ahasan Habib at 21-Feb-13 2:21am View
   
update solution. You just read it again.
S. M. Ahasan Habib at 21-Feb-13 1:32am View
   
So if you want to solve it with all browsers then you use this statement instead of just return false.
event.preventDefault ? event.preventDefault() : event.returnValue = false;
S. M. Ahasan Habib at 21-Feb-13 0:37am View
   
FileNotFoundException raised when file not found to a specific location. So I guess your file_path value is wrong. You just debug the code and see the value of file_path and find out that the file physically exists in this location (file_path).
S. M. Ahasan Habib at 20-Feb-13 11:11am View
   
instead of return false you should use
event.preventDefault ? event.preventDefault() : event.returnValue = false;
 
I already update your method IsNumericKey now it will work. Please Re run your code.
S. M. Ahasan Habib at 20-Feb-13 6:14am View
   
That will not create any problem. Anything else you found?
S. M. Ahasan Habib at 20-Feb-13 5:35am View
   
you need to debug the code and address which line of code throw InvalidOperationException and capture exception details and post that.
S. M. Ahasan Habib at 19-Feb-13 10:36am View
   
Why web config file refresh/reloaded is needed? If anything add/modify/delete any data in web.config file the web.config file cache automatically expired with app pool recycled. Please review your problem before go for solution.
S. M. Ahasan Habib at 19-Feb-13 6:37am View
   
Then make sure datacontract class dll reference in your project. DataContract class dll need to refer to your project, otherwise it do not find that datacontract class.
S. M. Ahasan Habib at 19-Feb-13 6:13am View
   
What type of problem you face to crate instance of ArithmeticClient datacontract object? Any compilation error? Please post error details.
S. M. Ahasan Habib at 19-Feb-13 5:05am View
   
What is you question?
S. M. Ahasan Habib at 19-Feb-13 4:53am View
   
I never work with OpenOffice spereadsheet. But the way you luch ms excel same way you can lunch OpenOffice. Just you find out what the main executable file name and location, After getting that you send that path to the System.Process.Start methods as argument.
S. M. Ahasan Habib at 19-Feb-13 4:35am View
   
Just post your code. You may debug the code and find out the line/object where object reference null found. If you identify object which is throwing null reference exception, hope you can solve it by your own.
S. M. Ahasan Habib at 18-Feb-13 23:08pm View
   
Reason for my vote of 5 \n Nice!
S. M. Ahasan Habib at 18-Feb-13 23:03pm View
   
Reason for my vote of 5 \n Nice!
S. M. Ahasan Habib at 18-Feb-13 10:12am View
   
I checked it by assigning txtId.Text ="hi" from form load events and found it is working.
S. M. Ahasan Habib at 18-Feb-13 6:33am View
   
Then you need to assign that controls value with other events like OnInit,OnLoad,OnPreRender etc, not inside DayRender event.
S. M. Ahasan Habib at 16-Feb-13 22:05pm View
   
thanks for your comment. Added exception handling and transaction block.
S. M. Ahasan Habib at 16-Feb-13 22:04pm View
   
Deleted
thanks for your comment. Added exception handling and transaction block.
S. M. Ahasan Habib at 15-Feb-13 5:42am View
   
Instead of jScriptArray[i] = array[i]; you will use jScriptArray.push(array[i]); in your code and it will work.
S. M. Ahasan Habib at 15-Feb-13 4:08am View
   
Deleted
If that is your data then no problem. You missed the javascript array push method.
Please check the code
var array =[{"AutoKey":1,"MachineGroup":"Atyc","StartDate":"\/Date(1322002860000)\/","EndDate":"\/Date(1322027095000)\/","Duration":24235},{"AutoKey":2,"MachineGroup":"Fongs","StartDate":"\/Date(1322003160000)\/","EndDate":"\/Date(1322012194000)\/","Duration":9034},{"AutoKey":3,"MachineGroup":"Then","StartDate":"\/Date(1322005320000)\/","EndDate":"\/Date(1322019001000)\/","Duration":13681}];
console.log(array.length);
var newArray = [];
for(var i=0, j=array.length; i
S. M. Ahasan Habib at 15-Feb-13 1:16am View
   
Question not clear. What do you mean by api fun?
S. M. Ahasan Habib at 14-Feb-13 1:00am View
   
Reason for my vote of 5 \n Nice tips!
S. M. Ahasan Habib at 12-Feb-13 12:08pm View
   
Reason for my vote of 5 \n Nice!
S. M. Ahasan Habib at 7-Feb-13 22:06pm View
   
Reason for my vote of 5 \n Nice!
Ahasanhabib at 22-Mar-12 7:18am View
   
Reason for my vote of 5
Very helpful tips. Thanks for sharing.
Ahasanhabib at 18-Feb-12 11:39am View
   
Deleted
Reason for my vote of 5
Very clear explanation.

Advertise | Privacy | Mobile
Web03 | 2.8.140814.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid