|
rattlesnake316 wrote: Does anybody know when specifically this error happens?
Whehe, pointing out a generic exception, without access to code?
Seems you're missing an exception-handler: "at System.Web.UI.Page.HandleError(Exception e)". What happens in that method?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Have you tried to set a break point and step through the code?
In order to help you with this, we would need to see the code that is generating the error and what you were attempting to do when you received it.
|
|
|
|
|
Hi
I have downloaded SharpWebMail from sourceforge, but I am unable to integrate in my existing Asp.Net Project which is made in asp.net 3.5
Please suggest me to integrate this code in my project.
thanks
|
|
|
|
|
Guys;
I have run a code that connect to an excel file on a web service and it worked.
now I run the same code on a windows service running on the same host but it gave me the exception of:
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Help people,so poeple can help you.
|
|
|
|
|
|
Item #4 of the above link states that it is not intended for "Quote: ... a program called from server-side web application such as ASP.NET ...
So what is the preferred method to access data stored in Excel for an ASP.NET application ?
I understand that you don't want to build an OLTP system usign Excel as a datastore ... but I have a situation where there is a spreadsheet which is updated by one department and I was thinking of buidling a simple webpage which would be used as search front-end for folks who do not have "edit" access to the Excel doc. Should be OK? Right?
|
|
|
|
|
If I recall correctly in Win7 Ole JET DB is deprecated and you should use mentioned ACE.OLEDB.12.0.
For older systems use JET. This should be installed with office and one of them should be accessible.
In my app I use web.config connection: jet for production with older version of WinServer and OLEDB for my Win7 dev machine.
I don't know if there is better way.
No more Mister Nice Guy... >: |
|
|
|
|
|
If your application running in 64 bit machine,
change the "Platform target" into X86 in project properties.
I hope it will work for you.
|
|
|
|
|
Hi All, I want to create an exam program consisting of questions and bunch of groupboxes each containing several radio buttons. Each question has a groupbox below it. The questions and their corresponding possible answers are stored on a database which will be bound to the the radio buttons at runtime. To answer an exam question, test takers will click on the radio button next to the correct answer. I would like to give each test taker a different test by rearrange the test questions by randomly changing the order of the questions and randomly changing the order of the possible answers. Randomizing the order of the questions is pretty straight forward using the Random Class to randomly display the questions but I don't know how to randomly bind data from the database to the radio buttons in the groupboxes. Please explain how this can be done or point me to a site where there's a tutorial on doing this if you know of one. Thanks in advance.
modified 6-Oct-12 11:42am.
|
|
|
|
|
Hi Dear,
I have worked on this type of project...
The following is the stored procedure you can use for randomly getting the questions as well as the random options (answers) from the database.
This stored procedure covers almost your 80% of the work, only the thing is you have to bind it to the gridview . If you have any doubts in this you can comment.
//////////////////////////////////////////////////////////////////////////////////////
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER
Procedure [dbo].[GetRandomOptionsold]
(@class varchar(max),
@Subject varchar(max),
@ExamType varchar(max),
@School varchar(max)
)
as
Begin
Create
Table #Options(ID int identity(1,1),Fields nvarchar(10))
Insert
into #Options
Select
COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME='Questions' And COLUMN_NAME like 'O%' Order By NEWID()
Declare
@RandomCols nvarchar(100)
Set
@RandomCols=''
Select
@RandomCols=@RandomCols+Fields+' ,' from #Options
Set
@RandomCols=(Select REPLACE(Substring(@RandomCols,0,CHARINDEX(' ,',@RandomCols)+2),' ,',' as O1,')
+
SUBSTRING(@RandomCols,CHARINDEX(' ,',@RandomCols)+2,LEN(@RandomCols)))
Set
@RandomCols=(Select REPLACE(Substring(@RandomCols,0,CHARINDEX(' ,',@RandomCols)+2),' ,',' as O2,')
+
SUBSTRING(@RandomCols,CHARINDEX(' ,',@RandomCols)+2,LEN(@RandomCols)))
Set
@RandomCols=(Select REPLACE(Substring(@RandomCols,0,CHARINDEX(' ,',@RandomCols)+2),' ,',' as O3,')
+
SUBSTRING(@RandomCols,CHARINDEX(' ,',@RandomCols)+2,LEN(@RandomCols)))
Set
@RandomCols=(Select REPLACE(Substring(@RandomCols,0,CHARINDEX(' ,',@RandomCols)+2),' ,',' as O4,')
+
SUBSTRING(@RandomCols,CHARINDEX(' ,',@RandomCols)+2,LEN(@RandomCols)))
Declare
@strQry nvarchar(MAX)
Set
@strQry=''
Set
@strQry='Select qno,que,'+@RandomCols+'ans from Questions where Class='''+@Class+''' and Subject='''+@Subject+''' and ExamType='''+@ExamType+''' and School='''+@School+''''
exec
(@strQry)
End
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
If it has not solved your problem , please let me know ...
|
|
|
|
|
I have the following code and SQL:
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_connection.Open();
sql_command = new MySqlCommand("sp_delete_channel", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_command.Parameters.AddWithValue("param_channel_id", channel_id).MySqlDbType = MySqlDbType.Int32;
sql_command.Parameters.AddWithValue("param_volow_member_id", Convert.ToInt32(Session["volow_member_id"])).MySqlDbType = MySqlDbType.Int32;
sql_command.Parameters.Add("param_is_channel_created", MySqlDbType.Bit).Direction = ParameterDirection.Output;
int result_rows = sql_command.ExecuteNonQuery();
if (Convert.ToBoolean(sql_command.Parameters["param_is_channel_created"].Value) != true)
{ Session["is_channel_created"] = false; }
and this is MySQL stored procedure:
BEGIN
SET param_is_channel_created = TRUE;
DELETE FROM member_posts WHERE member_channel_id = param_channel_id;
DELETE FROM member_channels WHERE member_channel_id = param_channel_id;
IF NOT EXISTS (SELECT member_channel_id FROM member_channels WHERE volow_member_id = param_volow_member_id) THEN
BEGIN
UPDATE volow_members SET is_channel_created = FALSE;
SET param_is_channel_created = FALSE;
END;
END IF;
END
but nothing is happending and I am sure all are ok because I change something in the storedprocedure and I got and error but with the above I don''t get any error and page is just reloading with the same data when I click the delete button?
Kindly help...
|
|
|
|
|
I don't write in c-sharp, but vb is my thing, but I did my best to rewrite the function in how I think it should be written. The catch will tell you what's wrong with your function or TSQL.
Also it's best practice to package everything first, then open the database, execute, and close the database all in 1 shot.
I can't test your TSQL, in my tester program, that would take another 20 minutes for me.
exitCode int = 2;
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_command = new MySqlCommand("sp_delete_channel", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
param_Channel_ID SqlParameter = new SqlParameter("@param_channel_id", SqlDbType.Int);
param_Channel_ID.Value = channel_id;
sql_command.Add(param_Channel_ID);
param_Member_ID SqlParameter = new SqlParameter("@param_volow_member_id", SqlDbType.Int);
param_Member_ID.Value = Convert.ToInt32(Session["volow_member_id"]);
sql_command.Add(param_Memeber_ID);
param_Created SqlParameter = new SqlParameter("@param_is_channel_created", SqlDbType.Bit);
param_Created.Value = Convert.ToBoolean(ParameterDirection.Output);
sql_command.Add(param_Created_ID);
try {
sql_connection.Open();
sql_reader SqlDataReader = sql_command.ExecuteReader();
sql_command.ExecuteNonQuery();
sql_reader.Close();
sql_connection.Close();
exitCode = 0
}
catch ex as SQLException {
exitCode = 1
}
return exitCode;
BEGIN
SET param_is_channel_created = TRUE;
DELETE FROM member_posts WHERE member_channel_id=@param_channel_id;
DELETE FROM member_channels WHERE member_channel_id=@param_channel_id;
IF NOT EXISTS (SELECT member_channel_id FROM member_channels WHERE volow_member_id=@param_volow_member_id) THEN
BEGIN
SET param_is_channel_created = FALSE;
UPDATE volow_members SET is_channel_created=param_is_channel_created;
END;
END IF;
END
|
|
|
|
|
thanks for the reply
but the problem is my code is not throwing any exception error as if everything is normal and it's not doing what is should do (deleting the record)!!
|
|
|
|
|
May be your gridview data is not refreshing because of the dataset , please check, and Is this deleted from the database?
|
|
|
|
|
Please check the value of "int result_rows" also at first glance it seems that "IF NOT EXISTS" part wont be executed atall returning always "param_is_channel_created = TRUE"
|
|
|
|
|
there is datagrid VijayChauhan123
Sunil: the DELETE is before the IF NOT EXIST so it should have been invoked.
|
|
|
|
|
I even tried this simple delete but still not working:
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_command = new MySqlCommand("sp_delete_channel", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_connection.Open();
sql_command.Parameters.AddWithValue("param_channel_id", channel_id).MySqlDbType = MySqlDbType.Int32;
int result_row = sql_command.ExecuteNonQuery();
and SQL:
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_delete_channel`(IN param_channel_id int, IN param_volow_member_id int, OUT param_is_channel_created bit)
BEGIN
DELETE FROM member_posts WHERE member_channel_id = param_channel_id;
DELETE FROM member_channels WHERE member_channel_id = param_channel_id;
IF NOT EXISTS (SELECT member_channel_id FROM member_channels WHERE volow_member_id = param_volow_member_id) THEN
BEGIN
UPDATE volow_members SET is_channel_created = FALSE;
SET param_is_channel_created = FALSE;
END;
ELSE SET param_is_channel_created = TRUE;
END IF;
END
|
|
|
|
|
I even tried this simple delete but still not working. No error and records not getting deleted!!!
sql_connection = new MySqlConnection(ConfigurationManager.ConnectionStrings["SQLdb"].ConnectionString);
sql_command = new MySqlCommand("sp_delete_channel", sql_connection);
sql_command.CommandType = CommandType.StoredProcedure;
sql_connection.Open();
sql_command.Parameters.AddWithValue("param_channel_id", channel_id).MySqlDbType = MySqlDbType.Int32;
int result_row = sql_command.ExecuteNonQuery();
and SQL:
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_delete_channel`(IN param_channel_id int, IN param_volow_member_id int, OUT param_is_channel_created bit)
BEGIN
DELETE FROM member_posts WHERE member_channel_id = param_channel_id;
DELETE FROM member_channels WHERE member_channel_id = param_channel_id;
IF NOT EXISTS (SELECT member_channel_id FROM member_channels WHERE volow_member_id = param_volow_member_id) THEN
BEGIN
UPDATE volow_members SET is_channel_created = FALSE;
SET param_is_channel_created = FALSE;
END;
ELSE SET param_is_channel_created = TRUE;
END IF;
END
|
|
|
|
|
Can you check if the SP itself works as expected by passing parameters (from ssms itself)
|
|
|
|
|
How to Develop asp.net application to control Time and authentication fingerprint Device such as get user ID from Device,enroll new user and act..
Thanks All...
|
|
|
|
|
You need to start with the manufacturer of the device. The vendor will have a programming guide or API that will allow you to communicate with the device. There is no industry standard for communicating to these devices.
|
|
|
|
|
After getting API of Device,what's the next step in programming and How can i deal with API in asp.net,because it is first time to deal with api in c# programming
THanks David...
|
|
|
|
|
There will be already developed dll's or functions, you can call them directly...
this is very interesting and very easy, once you jump into that you will feel cool.
|
|
|
|
|
HI
Is there any working solution for how to Run an URL inside a WCF webservice, the URL return a mp3/zip file.
and output of the web service also return those mp3/zip file with prompt "open/save" options in the browser.
my aim to be restrict End user not to know the actual download URL.
I am using below code, but this will not asking for prompt(open/save), i need to specify the path . it get faild if that path is not found any PC
ex: http://download.microsoft.com/download/C/9/4/C94B7FA8-E35F-4C96-8B35-7B183918298F/HDI_ITPro_MSDN_mp3_Installing_ASP_NET_and_Tools_v2.mp3
string remoteUri ="http://download.microsoft.com/download/C/9/4/C94B7FA8-E35F-4C96-8B35-7B183918298F/HDI_ITPro_MSDN_mp3_Installing_ASP_NET_and_Tools_v2.mp3";
string fileName = AppDomain.CurrentDomain.BaseDirectory +"\download\Tools_v2.mp3", myStringWebResource = null;
WebClient myWebClient2 = new WebClient();
myStringWebResource = remoteUri + fileName;
myWebClient2.DownloadFile(myStringWebResource, fileName);
|
|
|
|
|