|
Hi,
I want to have a video chat with the webcams within 2 computers , with asp.net and no limited bandwich , please help me , tnx
|
|
|
|
|
|
Dear friends,
I want to upload an Excel file from ASP.NET web form to Sql Server Database. I have all employees salary in the excel file. I want to upload it to the database through ASP.NET web form. I am using ASP.NET 3.5 with C# and SQL Server 2005. Please, anyone can help me, How to upload excel file using the FileUpload control? I need it urgently. Please help me.
Regards,
Dileep.
|
|
|
|
|
use this function
public static DataTable GetDataTableFromExcel(string SourceFilePath)
{
string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + SourceFilePath + ";" +
"Extended Properties=Excel 8.0;";
using (OleDbConnection cn = new OleDbConnection(ConnectionString))
{
cn.Open();
DataTable dbSchema = cn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (dbSchema == null || dbSchema.Rows.Count < 1)
{
throw new Exception("Error: Could not determine the name of the first worksheet.");
}
string WorkSheetName = dbSchema.Rows[0]["TABLE_NAME"].ToString();
OleDbDataAdapter da = new OleDbDataAdapter("SELECT * FROM [" + WorkSheetName + "]", cn);
DataTable dt = new DataTable(WorkSheetName);
da.Fill(dt);
return dt;
}
}
This will return you datatable after that with the help of loop insert it into database
|
|
|
|
|
Hi All,
Im created web application using .net 2008, and its hosted and working fine, now i created a another console application to my same solution as new project, i did some stuff there,added the reference from backend classes, its also woring fine.
My requirement is set that console application to SQL job, so i did that by setting my local solution path
(ex- E :\Test\WebApp\Console\Test.exe). its working fine too.
My problem is when i host this console application with web project, how can set the reference to console application?.
I created sub folder for console application inside my web project in hosting server, then added the console exe and app.config file, but that time my sql job is not working , should i add bin folder there?
what is the path should i follow?
Pls give some ideas?
Thanks
|
|
|
|
|
Think about it. With a web project, all of the code is executed a web server in a room somewhere in the world. A console app would execute on that same machine, if it were even allowed. Who would see the app?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i used that console app for some sort of mail sending mechanism, as i said i have set that console for SQL job already its wroking, what i really need to know is how can host that console in the same project?
|
|
|
|
|
indSoftware wrote: how can host that console in the same project
You can't, shouldn't, and it makes no sense to even try doing so. See my previous explanation.
If you simple want to execute code you don't need a console app to do so. Create a library and call class/method as necessary.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
ok thx for your reply, if i create a class library how can set that it to SQL job for daily scheduling.
Thanks.
|
|
|
|
|
The same way did in the console app. Seriously, you need stop and learn a bit more about the differences between console app, web apps and class libraries.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Dear friends,
I am working on ASP.NET 3.5 with C# Web Application. I want to upload some data to Sql Server Database. I am fetching some existing data from sql server database and want to display user like already these many records available in database. Do u still want to upload? If user clicks on yes it should display some other controls to upload data. If No, some other action to be taken. Please tell me how to prompt the user to do the above task. Please help me.
Thanks,
Dileep.
|
|
|
|
|
|
After implementing a CSS template to my web site i am getting the following error while running. "Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. "
I searched a lot in net and found some solutions which did not worked for me. But my actual problem is the same code is working in another browser. I am getting the error while i am using IE. What is the reason and solution???
|
|
|
|
|
Hi,
I am implementing error handling in my website developed in ASP.Net MVC & C#. To do this, I have set CustomErrors attribute in my web.config file as below
customErrors mode="On" defaultRedirect="Error.aspx"
This should ideally redirect user to default error page which is present in Views/Shared/Error.aspx.
This bebavior was working perfetly untill I changed the base class of my controller classes. Earlier, the base class was "Controller" but for some internal logic, I changed it to ControllerBase and my ControllerBase is now inherited from Controller class.
For example
HomeController : ControllerBase
{
...
...
}
ControllerBase : Controller
{
...
...
}
But now when I run the application and some unhandled error occurs, the user is not redirected to Error.aspx any more. Instead it gives error page as below. Even if I set custom errors mode to "On".
----------------------------------------------------------------------
<configuration>
<system.web>
<customerrors mode="RemoteOnly">
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.
<configuration>
<system.web>
<customerrors mode="On" defaultredirect="mycustompage.htm">
----------------------------------------------------------------------
Any help will be appreciated...
Thanks
Anil
|
|
|
|
|
Hi,
In my Web application, I have the following block of code :
app.Context.Response.StatusCode = 301;
app.Context.Response.Status = "301 Moved Permanently";
app.Context.Response.Redirect(urlRouteResult.RoutedUrl);
Recently, I read an article and found that, Response.Redirect issue the Http Status code 301, so is it redundant to use the code app.Context.Response.StatusCode = 301; when I am using app.Context.Response.Redirect(urlRouteResult.RoutedUrl); ?
|
|
|
|
|
Response.Redirect actually sends code 302 not 301. See MSDN [^]
|
|
|
|
|
Thanks,
So, if I want to send 301 code, is the following code my only option ?
app.Context.Response.StatusCode = 301;
app.Context.Response.Status = "301 Moved Permanently";
app.Context.Response.AddHeader("Location", urlRouteResult.RoutedUrl);
|
|
|
|
|
If you are using 4.0 there is already a method for this, RedirectPermanent[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
i m working on custom ajaxEditor Control
i have override FillTopToolbar() method of editor class and added some buttons.
now i want to add InsertImageButton to toolbar fro that i have written
TopToolbar.Buttons.Add(new AjaxControlToolkit.HTMLEditor.ToolbarButton.ImageButton());
but i m getting following error-
Cannot create an instance of the abstract class or interface 'AjaxControlToolkit.HTMLEditor.ToolbarButton.ImageButton'
so plz tell me how can i add this button to toolbar..
thanking u
|
|
|
|
|
this the same problem to me any solve????
|
|
|
|
|
Hi,
I want to add tablerows and columns on every button click in asp.net(C#.net) for existing table, after that i want to save all these rows data in the database. please help me out How to create table rows and columns dynamically and save in the database. Client will not allow the javascript in the pages.
Thanks in advance, and help me out.
-Murty
|
|
|
|
|
let say you have table name 'tblData'.
Now if you want to add table row then create table row by
TableRow tr = new TableRow();
Create table cell and add it to table row
TableCell tbcell = new TableCell();
tr.Controls.Add(tbcell);
Then add it to your table
tblData.Controls.Add(tr);
|
|
|
|
|
Thanks also from me!
I was wondering about that the other day, but then got distracted.
You have reminded me and solved it in one go
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
|
|
|
|
|
Thanks Dalek Dave
|
|
|
|
|
below code is default.aspx
but default.aspx was called so many time.
jungJava() function is called always and don't stop.
i don't know why....
////////////////////////////////////////////////////////////////////////////////
<script type="text/javascript">
function jungJava()
{
debugger;
alert("called");
document.getElementById("txtTest").value = "11000";
count++;
form1.submit();
}//function jungJava()
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="hidden" id="txtTest" name="txtTest" value = "1" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
<script type="text/javascript"> jungJava(); </script>
</html>
hi
My english is a little.
anyway, nice to meet you~~
and give me your advice anytime~
|
|
|
|