Web Forms :: Batch By Batch Reading Of A Text File?

Jan 25, 2010

I have a text file (test.txt) which contains n number of data like:

1234778
4567444
8970451
1212455
testhsdd
weresdfy
.
.
.
etc

I need to fetch first 75 data or lines and insert in the sql table. Again next 75 data or lines and insert in the sql table. Again next 75 data or lines and insert in the sql table until it finish all.How i can do it in ASP.NET with C#

View 6 Replies


Similar Messages:

Run A Batch File With IIS?

Sep 29, 2010

Apologies if my question is too broad but I eed pointers on how to tackle the following problem. Currently, I run a batch file that launches a series of automation tests on QTP (a test automation tool). The batch file contains a vbs script path and it takes three parameters. Each time smeone needs to run the automation, I have to do this manually.What I'd like to be able to do is to allow other members of the team to access this functionality via an intranet web page. They would be able to login, choose the tests to run and then run them. My only other requirement is that the solution be based on .net and C# if possible. My current server is 2003 SP2.What is the best way to achiveve what I want? What is the recommended version of IIS and .NET framework to use? How do I configure IIS to be able to run the vbs script? I'm looking for a step-by-step approach if possible. I don't care if I have to convert the batch file into an executable or run the script directly, just as long as it is launched.

View 3 Replies

Security :: Cannot Run Batch File From Under IIS

Dec 3, 2010

I have a problem which is a recent development. We used to be able to run a batch file from IIS, but now we can't. I have tried several different approaches to this issue, none of them have worked. I tried to run the batch file under cmd using CreateProcess, CreateProcessWithLoginW, CreateProcessAs User, none of which worked. I now know that CreateProcesswithLogonW won't work on Windows 2003 Server. This is a C++ webservice by the way, running on Windows 2003 server using IIS 5.1. I have also tried running the batch file from a vbs script and calling the script in C++ using system("Scriptname") and that does not work either. I have run out of options, or at least the options that I know about.

I learned that "EXEs in System32, which like CMD.EXE have "special" ACLs that prevent them from being launched remotely from IIS. CMD.EXE has further security checks inside of it to prevent being used to launch batch scripts launched remotely from IIS." So I have abondoned even attempting to run CreateProcess of anykind where I invoke "cmd.exe" to run a batch file. Which was why I tried the vbscript. I know this is a security issue. It has to do with either the NETWORK SERVICE account or the ASPNET account not having permission to do this. I have QA breathing down my neck at this point and I really need to figure out what to do. If it is a security setting that can be set without compromising security on the server then great (although I bet that isn't the case).

View 1 Replies

Create And Run A Batch File?

Jan 17, 2011

I need to know, how can one create a batch file(.bat) and run the same at a specified time (say everyday at 12am midnight) in asp.net(C#).

View 4 Replies

Run A Batch File At Server Side?

Sep 4, 2010

I am creating an intranet application which runs a batch file and create an xml file as result. Which i am using for further processing. My problem is when i am running my application from local machine batch file is running fine and creating xml,but when i am running it through iis nohting is happening,

it meance process.start coudn't start command Prompt.

I am using following code. I have given all permission to iis.

Dim ProcessInfo As Diagnostics.ProcessStartInfo
ProcessInfo = New Diagnostics.ProcessStartInfo("cmd.exe", "/C " + Server.MapPath("~myScript.bat"))
Dim Process As New Diagnostics.Process
ProcessInfo.CreateNoWindow = False
ProcessInfo.UseShellExecute = False

[code]...

View 3 Replies

Returning Value From Process (batch File) To Webpage?

Jan 13, 2011

I'm using the System.Diagnostics.Process class to run a batch file. I need to be able to take an output from the batch file and then display it on the web-page, basically to know if it succeeded or not, since the batch runs an .exe that doesn't always succeed.

the values returned by the .exe and have the batch run a script depending on the value returned. The script could be a VBscript that sends info to the webpage, but even then I'm not sure how to accomplish this.

View 4 Replies

Security :: Run Batch File On Another Server Different Domain?

Feb 4, 2010

I have a batch file on another server on a different domain or network that I need to run from an ASP page. I found a simple enough script that opens a CMD prompt, goes to the location of the batch and runs it. If everything is on the same machine, it runs fine.

The issue I've run into now is that the batch file is on a file server and the ASP page is on a IIS server. The File server is on a internal network (separate domain) and the IIS server is on an external network (or different domain), both servers are hosted here.

When I try it and look at the event logs I can see a failure audit and its trying to login with the machine name.

View 1 Replies

How To Enable A Batch File To Create Output File On The Server Side

Mar 24, 2010

How to enable a batch file to create output file on the Server side?

View 1 Replies

SQL Server :: Open A Batch File In Sql Store Procedure?

Sep 29, 2010

I have to open a batch file automatically in sql. So i have used the below command.EXECUTE master.dbo.xp_cmdshell 'D:Databasesatch123.bat'Its worked for few times. After that its not working.One time i have stopped before the process is complete.May be this is the issue.Now its returns null value.

View 4 Replies

Security :: Cannot Execute The Windows Service As Well As Batch File On Web

Jan 8, 2010

i have made one web site which is generating screensaver(MSI) dynamically.So to generate the MSI file i have to build a WIX project.So i executed using batch file which will use MSBuild.exe and cmd prompt. so its gave me an error "Access is Denied". i have also tried by making a windiws service but still the same error occurs.

View 1 Replies

Can Launch Cassini Web Server From A Command Line Or Batch File

Dec 28, 2010

Is there anyways to launch Cassini web server from a command line? The exe appears to be in this path, C:Program Files (x86)Common Filesmicrosoft sharedDevServer10.0

View 1 Replies

Publishing A Site In Release Mode Using Aspnet_compiler In Batch File?

Sep 12, 2010

i am trieng to create a batch task that will publish my site in release mode
but with no luck...my script for doing so is this:

aspnet_compiler -errorstack -nologo -fixednames -v / -p "C:projectsmysiteCOMPONENTSsitefolder" -f -u "C:projectspublish-mysite"

my site has about 10 other projects in the solution. so i expect them to all be published in release mode. (the site refrence those projects)

View 1 Replies

Configuration :: Process.start (System.Diagnostics.Process) - Execute A Batch File

Sep 7, 2010

I've written a aspx.net(C#) page that after the user has done what they do on the page they hit a Submit button. The Submit button

1) takes the work the users was producing on the page and writes it to a file.
2) attempts to execute a batch file.

The call to the batch file is executed via:

protected void Execute123EDI()
{
try
{
string File = @"c:80sAdminSendV80s.bat";
lblCancelled.Text = lblCancelled.Text + File;
Process proc = new System.Diagnostics.Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.LoadUserProfile = false;
proc.StartInfo.UserName = "administrator";
proc.StartInfo.RedirectStandardOutput = true;
System.Security.SecureString secPass = new System.Security.SecureString();
string paswd = "123abc";
for (int i = 0; i < paswd.Length; i++)
{
secPass.AppendChar(paswd[i]);
}
proc.StartInfo.Password = secPass;
proc.StartInfo.FileName = File;
proc.Start();
FileStream fs = new FileStream(@"c:80sAdminSendV80sOutput.log", FileMode.Append);
StreamWriter sw = new StreamWriter(fs);
sw.Write(proc.StandardOutput.ReadToEnd());
proc.WaitForExit();
sw.Close();
proc.Close();
}
catch(Exception ex)
{
lblDebug.Text = lblDebug.Text + ex.Message + "<br/>";
}

If I watch the processes tab in Task Manager on the web server I see "cmd.exe" under the context of 'administrator' but it just hangs. For test purposes c:SendV80s.bat: copy c: oot.ini c:zzz.txt

If I logon onto the webserver's console and execute SendV80s.bat it works and exits without issue. But when I execute the same batch file via the Submit button it gets stuck executing in Task Manager/Process. I believe this has something to do with the fact that cmd is not running in a full environment/desktop context. I just noticed this on the actual console of the webserver (not in my RDP console but console 0 instead)

A pop-up box stating: CMD.exe Application error The application failed to initialize properly (0xc0000142). Click OK to terminate the application. And when I click on the OK button my ASPX page's WaitForExit is satisfied and the continues processing normally.

View 2 Replies

C# - How To Invoke A Windows Scheduled Task Or A Batch File On A Server Different To The IIS Server

Sep 7, 2010

I have a asp.net web site, I would like a page on that site to be able to invoke a Windows Scheduled task or a batch file on a server different to the IIS server?

Is it possible?

View 2 Replies

IIS Is Unable To Run "net Use" Command In A Batch File?

Aug 27, 2010

have a CMS application that used to be able to run all the commands in a batch file; however, it has been failing in the last week. For testing, we have modified the contents in the batch file like this:

echo starting > c:log.txt
whoami >> c:log.txt
net use Z: \192.168.2.123share password /user:userWithAdminRightsInTarget
copy c:aTestFile.txt Z:Success.txt
net use Z:/DELETE

Let's say ComputerSource is the computer where IIS is hosting the CMS website and where the batch file resides, and ComputerTarget is the computer where I want to copy the files to.If I run the batch file manually by double clicking it, all commands are run successfully; the result of whoami in c:log.txt displays the user account that is logged into the server, and the file is copied successfully.However, if I run the batch file from the CMS website, it executes the first line "echo starting > c:log.txt" but fails afterwards. Both commputers are part of a domainWe have tested the application by using different domain names, even domain admin accounts.We have used impersonation in the website (specified in web.config file of cms website) as well as using domain admin accounts in IIS directory security. The result of the whoami command when the batch file is run from the website is nt/network service. We have practically tried almost anything.

View 2 Replies

Web Forms :: Can Enable A Batch Of Textboxes Visibility Switch

Sep 10, 2010

In a regular webform, I can enable a batch of textboxes Visibility switch on with the following command...

[Code]....

View 1 Replies

Forms Data Controls :: Batch Update In A Datalist?

Jan 4, 2010

I have a datalist and it contains a checkbox bound to a boolean value. I need to be able to scroll through the list, click on the appropriate checkboxes, and then update all using the button control. The only value in the sql table that needs updating is the checkbox, although other values are displayed. What is the simpliest way to do this. My code behind is C#. This is what I have now and it all works except for the actual update method being called correctly.

[Code]....

In code behind my click event:

[Code]....

View 5 Replies

Forms Data Controls :: Save Batch Of Changes From DataGrid Or GridView

Jan 29, 2010

I have a set of data that has been displayed as just a simple GridView with the item name being a hyperlink to view details. I'm attempting to update this scenario so certain fields (sortOrder and isApproved) are editable from the main page and do not require visiting each item in the grid. I have converted the GridView to a DataGrid and have included a TemplateColumn for the columns in question. I have them hooked up to display the values appropriately. At this point, I'm trying to find a way to peek into the DataGrid and it's related data source to determine if the values have changed on the click event of a button. At that point, I could persist those changes back to the respective SharePoint list.

I'm not very familiar with the DataGrid, or GridView for that matter. Can anyone point me in the correct direction on how I could gain access to the data source at an item/row level during a button click event where the button exists outside the context of the DataGrid?

View 1 Replies

How To Do VB Batch Printing

May 26, 2010

For my first project in vwd2008 with asp/vb i've created a work order system and everything's going well.. I use a gridview to show all work orders, and then i've been using a hyperlinkfield to link to a seperate page so that they can view and print the work order.

I've now been tasked with making it possible to print multiple work orders at once. How can i print multiple html pages at once without the user having to choose a printer each time?

I figure i can setup a checkbox for them to select the work orders.. and then create html links to each of the work orders..And then just use a button to start printing... ..but how would i print each of them?

[URL]

View 2 Replies

Forms Data Controls :: Batch Delete With SQLDataSource And Gridview Checkbox?

Mar 16, 2010

How do I modify this code to delete from SQLDataSource where the SQL command and parameters are specified in ASP?

[Code]....

View 7 Replies

Batch Upload In CSV Format?

Jan 5, 2010

We have a module in a system called Batch Upload. The function of this module is a user will upload a file and we have to upload the content of the file in the database. I already used excel file but it just compatible in 32bit. I think of a CSV file format then we will validate the file and upload the valid data in the database. Does anyone know how to do Batch Upload in CSV format?

View 1 Replies

How To Schedule A Batch Process

Apr 12, 2010

I want to schedule a batch process in my APPLICATION SERVER every night by calling a stored in my database.

View 4 Replies

Batch Upload To YouTube - C#?

Mar 14, 2011

I've tried searching for the best method of doing batch uploads to YouTube but I've only found methods for uploading a single video to YouTube (which is fine, but not my situation).

I'd like to know the best method of uploading multiple videos to YouTube. I noticed here:

[URL]

That it needs to be spread out so you don't reach the quota. However, I noticed that Batch Processing is available here:

[URL]

Is it possible to create a batch upload to YouTube using the request.Batch call? Or is the only method to loop through the videos to be uploaded and upload them one at a time (given a 3-5 minute delay between each one)?

View 1 Replies

Start Batch Job From IIS / Start Exe File With System.Diagnostics.Process.Start With Another Account Is Disabled?

Oct 28, 2010

What is the right approach when users (authenticated domain admins) should be able to start batch jobs (usually exe files) from an IIS (7.x) aspx (c#) page? This is an intranet site. The batch jobs have to run on the web server as Domain Admins. The website pool is executed by network service or some similar restricted account in AD.

Approaches I can think of (and their disadvantages):
1. Start exe file with System.Diagnostics.Process.Start with another account. This feature is disabled in IIS 7.x, how do I allow it?

2. Create a sheduled task and call scheduled task-api. This unmanaged dll is giving VS compiler warnings because it's unsafe to call from managed code.

3. I suppose there's a better approach, because the previous suggestions doesn't appear safe or robust.

View 2 Replies

Forms Data Controls :: What's Best Method Of Uploading Multiple / Batch Images / Photos

Oct 30, 2010

I would like to know what the best method of uploading a batch of images/photos would be. Below are the steps that need to be implemented: Select Multiple images/photos from a directoryUpload original images to webserverGenerate thumbnailsUpload thumbnails to webserverAdd image and thumbnail details to a Database Does anyone know any vb.net script that will allow me to do this or will I have to code it from sratch?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved