Search Results

Search found 2316 results on 93 pages for 'cmd'.

Page 41/93 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • sp_executesql with 'IN' statement

    - by user300992
    I am trying to use sp_executesql to prevent SQL injection in SQL 2005, I have a simple query like this: SELECT * from table WHERE RegionCode in ('X101', 'B202') However, when I use sp_executesql to execute the following, it doesn't return anything. Set @Cmd = N'SELECT * FROM table WHERE RegionCode in (@P1)' SET @ParamDefinition = N'@P1 varchar(100)'; DECLARE @Code as nvarchar(100); SET @Code = 'X101,B202' EXECUTE sp_executesql @Cmd, @ParamDefinition, @P1 = @Code The is what I have tested: SET @Code = 'X101' <-- This works, it returns a single region SET @Code = 'X101,B202' <--- Returns nothing SET @Code = '''X101'',''B202''' <-- Returns nothing Please help.... what did I do wrong?

    Read the article

  • Customize MS dynamic CRM entity in visua studio 2008

    - by Lalit
    Hi, I have installed the MS dynamic CRM on my windows server 2003. I want to add the javascript to the one of entity that has drop down control. let say Opportunity entity. But I don't know how to open the CRM in visual studio so that i can make changes. I have installed CRM explorer as well as Install the CRM Solution Framework(under folder\CRMSolutionFrameworkTemplate\Setup.cmd) Using command prompt to install: Setup.cmd {InstallDir} {ProjectName} {Project Long Name} {Organization Name} How to make the chanes, how to get the CRM in VS for edit. While opening the soution from "C:\Projects\MyCrmSolution\SourceCode\MyCrmSolution" It giving error as :"Mcrosoft.sourceanalysis.target not found error so it can not open the solution". please guide I am new in this stuff....

    Read the article

  • ADO.NET - DataRead Error

    - by user560706
    Hi, I am trying to display data from a column in my database onto my rich textbox, but I am getting mixed up between DataSet and DataReader - I know the majority of the code below is correct, I just get two lines containing errors, and I'm not sure why: // Create a connection string string ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= C:\\Documents and Settings\\Harley\\Desktop\\Test.accdb"); string SQL = "SELECT * FROM Paragraph"; // create a connection object SqlConnection conn = new SqlConnection(ConnectionString); // Create a command object SqlCommand cmd = new SqlCommand(SQL, conn); conn.Open(); DataTable dt = new DataTable(); da.Fill(dt); //ERROR // Call ExecuteReader to return a DataReader SqlDataReader reader = cmd.ExecuteReader(); foreach(DataRow reader in dsRtn) //ERROR { richTextBox = richTextBox.Text + reader[0].ToString(); } //Release resources reader.Close(); conn.Close(); }

    Read the article

  • Background upload in PHP

    - by Robijntje007
    I am working with a form that allows me to upload files via a local folder and FTP. So I want to move files over ftp (which already works) Because of performance reasons I chose this process to run in the background so I use nfcftpput (linux) In CLI the following command works perfectly: ncftpput-b-u name -p password -P 1980 127.0.0.1 /upload/ /home/Downloads/upload.zip (Knowing that the b-parameter triggers background process) But if I run it via PHP it does not work (without the-b parameter it does) PHP code: $cmd = "ncftpput -b -u name -p password -P 1980 127.0.0.1 /upload/ /home/Downloads/upload.zip"; $return = exec($cmd);

    Read the article

  • [PHP] background upload

    - by Robijntje007
    I am working with a form that allows me to upload files via a local folder and FTP. So I want to move files over ftp (which already works) Because of performance reasons I chose this process to run in the background so I use nfcftpput (linux) In CLI the following command works perfectly: ncftpput-b-u name -p password -P 1980 127.0.0.1 /upload/ /home/Downloads/upload.zip (Knowing that the b-parameter triggers background process) But if I run it via PHP it does not work (without the-b parameter it does) PHP code: $cmd = "ncftpput -b -u name -p password -P 1980 127.0.0.1 /upload/ /home/Downloads/upload.zip"; $return = exec($cmd);

    Read the article

  • Is it possible to Update Sharepoint List Without "ID" ?

    - by Pari
    I want to Upload File on Sharepoint and while apploading only i want to add all properties of Uploaded Document. We get ID field only when Document is uploaded on Sharepoint. Is there any other way to Update List without passing ID Field. Example: <Batch OnError="Continue" ListVersion="1" ViewName="270C0508-A54F-4387-8AD0-49686D685EB2"> <Method ID="1" Cmd="Update"> <Field Name="ID">4<Field> <Field Name="Field_Name">Value</Field> </Method> <Method ID="2" Cmd="Update"> <Field Name="ID" >6</Field> <Field Name="Field_Name">Value</Field> </Method> </Batch> Refering Link I am using Sharepoint Web Services.And Uploading Document in Chunks.**

    Read the article

  • How to make DropDownList automatically be selected based on the Label.Text

    - by Archana B.R
    I have a DropDownlist in the GridView, which should be visible only when edit is clicked. I have bound the DropDownList from code behind. When I click on Edit, the label value of that cell should automatically get selected in the DropDownList. The code I have tried is: protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { SqlCommand cmd = new SqlCommand("SELECT Location_Name FROM Location_Table"); DropDownList bind_drop = (e.Row.FindControl("DropList") as DropDownList); bind_drop.DataSource = this.ExecuteQuery(cmd, "SELECT"); bind_drop.DataTextField = "Location_Name"; bind_drop.DataValueField = "Location_Name"; bind_drop.DataBind(); string Loc_type = (e.Row.FindControl("id2") as Label).Text.Trim(); bind_drop.Items.FindByValue(Loc_type).Selected = true; } } When I run the code, it gives an exception error Object reference not set in the last line of the above code. Cannot find out whats wrong. Kindly help

    Read the article

  • Between-request Garbage Collection using Passenger

    - by raphaelcm
    We're using Rails 3.0.7 and REE 1.8.7. Long-term, we will be upgrading, but at the moment it's not feasible. Following the advice of several blog posts, we've been tuning our GC, and have settings that work pretty well. But we would really like to run GC outside of the request-response cycle. I've tried patching Passenger per this post, and using the code supplied in this SO question. In both cases, GC does indeed happen between requests. However, every time the between-request GC happens, I see a bunch of this: MONGODB [INFO] Connecting... MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1) MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1) MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1) Starting the New Relic Agent. Installed New Relic Browser Monitoring middleware SQL (0.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES RefinerySetting Load (0.0ms) SELECT `refinery_settings`.* FROM `refinery_settings` WHERE `refinery_settings`.`scoping` = 'pages' AND `refinery_settings`.`name` = 'use_marketable_urls' LIMIT 1 SQL (0.0ms) BEGIN RefinerySetting Load (0.0ms) SELECT `refinery_settings`.* FROM `refinery_settings` WHERE `refinery_settings`.`id` = 1 LIMIT 1 AREL (0.0ms) UPDATE `refinery_settings` SET `value` = '--- \"false\"\n', `callback_proc_as_string` = NULL WHERE `refinery_settings`.`id` = 1 SQL (0.0ms) SHOW TABLES RefinerySetting Load (0.0ms) SELECT `refinery_settings`.* FROM `refinery_settings` SQL (0.0ms) COMMIT SQL (0.0ms) SHOW TABLES RefinerySetting Load (4.0ms) SELECT `refinery_settings`.* FROM `refinery_settings` WHERE `refinery_settings`.`scoping` IS NULL AND `refinery_settings`.`name` = 'user_image_sizes' LIMIT 1 SQL (0.0ms) BEGIN RefinerySetting Load (0.0ms) SELECT `refinery_settings`.* FROM `refinery_settings` WHERE `refinery_settings`.`id` = 17 LIMIT 1 AREL (0.0ms) UPDATE `refinery_settings` SET `value` = '--- \n:small: 120x120>\n:medium: 280x280>\n:large: 580x580>\n', `callback_proc_as_string` = NULL WHERE `refinery_settings`.`id` = 17 SQL (0.0ms) SHOW TABLES RefinerySetting Load (0.0ms) SELECT `refinery_settings`.* FROM `refinery_settings` SQL (0.0ms) COMMIT ******** Engine Extend: app/helpers/blog_posts_helper SQL (0.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES SQL (4.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES ******** Engine Extend: app/models/user SQL (0.0ms) describe `roles_users` SQL (0.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES SQL (4.0ms) describe `roles_users` SQL (0.0ms) SHOW TABLES SQL (4.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES SQL (0.0ms) SHOW TABLES (etc, etc, etc) Which is what happens when rails "loads the world" when the app starts up. Basically, GC.start is re-loading the app for some reason. Because of this, between-request GC is much slower than inline GC. Is there a way around this? I would love to have snappy, between-request GC if possible. Thanks.

    Read the article

  • Why vba doesnt handling Error 2042

    - by Jonathan Raul Tapia Lopez
    I have a variable "fila" with a full line with excel's values; The problem is when in excel I have --#N/A-- vba take that value like "Error 2042" and I cannot asign that value to "valor" and produce me an error, until this point everything is ok, now I am trying to define a "On error goto" for go to the "next" iteration in the loop "for", but I dont know Why vba doesnt handle the error. Do While Not IsEmpty(ActiveCell) txt = ActiveCell.Value2 cell = ActiveCell.Offset(0, 1).Value2 fila = Range("C20:F20") For j = 1 To UBound(fila, 2) On Error GoTo Siguiente If Not IsEmpty(fila(1, j)) Then valor = fila(1, j) cmd = Cells(1, j + 2).Value2 devolver = function1(cmd, txt, cell, valor) arrayDevolver(p) = devolver p = p + 1 End If Siguiente: Next Loop '

    Read the article

  • Maven release prepare without prompts?

    - by Bruce Settergren
    I want to automate the execution of Maven release:prepare with Perl so that the user doesn't have to answer the prompts for version names etc. Are there a -D arguments that can be supplied so that no prompting is done? I tried the obvious solution which is to feed the prompt answers to mvn via perl code like this: my $cmd = qq(mvn release:prepare -DautoVersionSubmodules=true-DpreparationGoals="clean install"); open MVN, "| $cmd"; print MVN "\n"; # default print MVN "$cur_version"; print MVN "\n"; print MVN "$next_version"; print MVN "\n"; close MVN; but mvn ignores such input and winds up using the defaults (and doesn't prompt either). So, are there -D args for the release:prepare plugin:goal? Thanks.

    Read the article

  • Insert values into dataset

    - by sudha.s
    Am using vb.net.Having dataset contain column name as phone .it contain set of phone number. i want to add 0 to each phone number and store it in another dataset. my code -------- cmd = New OracleCommand("select substr(PHONE,-10)as PHONE from reports.renewal_contact_t where run_date=to_date('" + TextBox1.Text + "','mm/dd/yyyy') and EXP_DATE =to_date('" + TextBox2.Text + "','mm/dd/yyyy') and region not in('TNP')", cn) ada = New OracleDataAdapter(cmd) ada.Fill(ds, "reports.renewal_contact_t ") Dim ds1 As New DataSet ds1 = ds.Clone() For Each q In ds.Tables(0).Rows phone = z + q("PHONE").ToString For Each q1 In ds1.Tables(0).Rows q1("PHONE") = phone Next Next my problem is am not getting values in ds1.Please help me to correct it.

    Read the article

  • Define a new handle (Similar to STDOUT)

    - by Monacraft
    I was looking at redirecting handles in batch, when I noticed this: Here is the link It mentions that Handle 3-9 are undefined and can be defined by a program. Now I've read about doing this in C#, but I wondered if this was possible in cmd/batch - and if it is what are its limitations/use. If it is not possible in cmd how would I go about using this, and could it be a soloution to outputing data to the screen and redirecting it to a file at the same time (a problem which has not been able to be done legitametly at the same time). Thanks, Mona.

    Read the article

  • How to find that 'runas' execution finished?

    - by Radek
    I use ruby 1.9.3p194 (2012-04-20) [i386-mingw32] on Windows7 To do mySQL backup I run runas /savecred /user:yogurt\administrator "cmd.exe /k mysqldump --user=#{dbuser} --password=#{dbpassword} #{dbname} > #{dump}" - mysqldump must be executed as administrator. I do not run my ruby scripts under administrator account. runas starts new cmd.exe and ruby doesn't wait for it to finish. Dump process takes about one minute to finish. After that I zip the dump file and delete it. But I have to make sure that the dump process already finished before I do any other action on that file. Right now I use sleep(60) that works but I wonder if there any better more systematic solution.

    Read the article

  • Detect if an instance is running with kernel32::CreateMutexA

    - by moz
    Hello. I'm working on an NSIS installer, and trying to check if a certain application is running before uninstalling. So, I use kernel32::CreateMutexA call. Here is the chunk: System::Call 'kernel32::CreateMutexA(i 0, i 0, t "cmd.exe") i .r1 ?e' Pop $R0 StrCmp $R0 0 +3 MessageBox MB_USERICON "The application is already running." Abort I put it into un.onInit. Trouble is, the process (cmd.exe here) is never detected. Did I miss something? Tx.

    Read the article

  • How to convert ms access data into pdf in vb.net

    - by user225269
    I want to convert the ms access data into a document so that the print function in vb.net will read it. Where do I start from here? Here is my form: http://screencast.com/t/MGU4N2UyNmY And here is the code for print preview. Try PrintPreviewDialog1.ShowDialog() Catch es As Exception MessageBox.Show(es.Message) End Try How do I incorporate the above code, to the code below so that there is something that can be seen when I hit the print button? Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\search.mdb") Dim cmd As OleDbCommand = New OleDbCommand("Select * from GH where NAME= '" & TextBox6.Text & "' ", cn) cn.Open() Dim rdr As OleDbDataReader rdr = cmd.ExecuteReader If rdr.HasRows Then rdr.Read() NoAcc = rdr("NAME") If (TextBox6.Text = NoAcc) Then TextBox1.Text = rdr("IDNUMBER") If (TextBox6.Text = NoAcc) Then TextBox7.Text = rdr("DEPARTMENT") If (TextBox6.Text = NoAcc) Then TextBox8.Text = rdr("COURSE") End If Please help,thanks

    Read the article

  • Can I accesss an external file when testing an R package?

    - by Abe
    I am using the testthat package to test an R package that is within a larger repository. I would like to test the contents of a file outside of the R package. Can I reference a file that is located outside of an R package while testing? What I have tried A reproducible example can be downloaded as MyRepo.tar.gz My repository is called "myRepo", and it includes an R package, "myRpkg" and a folder full of miscellaneous scripts ~/MyRepo/ ~/MyRepo/MyRpkg ~/MyRepo/Scripts The tests in "MyRpkg" are in the /tests/ folder ~/myRepo/myRpkg/tests/test.myscript.R And I want to be able to test a file in the Scripts folder: ~/MyRepo/Scripts/myscript.sh I would like to read the script to test the contents of the first line doing something like this: check.script <- readLines("../../../Scripts/myscript.sh")[1] expect_true(grepl("echo", check.script)) This works fine if I start from the MyRepo directory: cd ~/MyRepo R CMD check MyRpkg But if I move to another directory, it fails: cd R CMD check MyRepo/MyRpkg

    Read the article

  • Any way to assign terminal output to variable with python?

    - by Gordon Fontenot
    I need to grab the duration of a video file via python as part of a larger script. I know I can use ffmpeg to grab the duration, but I need to be able to save that output as a variable back in python. I thought this would work, but it's giving me a value of 0: cmd = 'ffmpeg -i %s 2>&1 | grep "Duration" | cut -d \' \' -f 4 | sed s/,//' % ("Video.mov") duration = os.system(cmd) print duration Am I doing the output redirect wrong? Or is there simply no way to pipe the terminal output back into python?

    Read the article

  • I want search a item frome database

    - by vishal
    I want search a item frome database bye date and id but if I want to search only by date or id tahn data are display but if I want to search by both date and id than not both are display but combine both and than display. my code: SqlConnection con = new SqlConnection("Data Source=NODE5-PC;Initial Catalog=hans;Persist Security Info=True;User ID=sa;Password=123"); cmd = new SqlCommand("SELECT UserId, Date, Report FROM Daily_Report WHERE (Date='" + txtdate.Text + "' or UserId='" + txtempid.Text + "') OR (UserId='" + txtempid.Text + "' and UserId='" + txtempid.Text + "')", con); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); GridView2.DataSource = rdr; GridView2.DataBind(); con.Close();

    Read the article

  • [C# n MySQL] Creating a database using Connector/NET Programming?

    - by yeeen
    How to create a database using connector/net programming? How come the following doesn't work? string connStr = "server=localhost;user=root;port=3306;password=mysql;"; MySqlConnection conn = new MySqlConnection(connStr); MySqlCommand cmd; string s0; try { conn.Open(); s0 = "CREATE DATABASE IF NOT EXISTS `hello`;"; cmd = new MySqlCommand(s0, conn); conn.Close(); } catch (Exception e) { Console.WriteLine(e.ToString()); }

    Read the article

  • Python performance profiling (file close)

    - by user1853986
    First of all thanks for your attention. My question is how to reduce the execution time of my code. Here is the relevant code. The below code is called in iteration from the main. def call_prism(prism_input_file,random_length): prism_output_file = "path.txt" cmd = "prism %s -simpath %d %s" % (prism_input_file,random_length,prism_output_file) p = os.popen(cmd) p.close() return prism_output_file def main(prism_input_file, number_of_strings): ... for n in range(number_of_strings): prism_output_file = call_prism(prism_input_file,z[n]) ... return I used statistics from the "profile statistics browser" when I profiled my code. The "file close" system command took the maximum time (14.546 seconds). The call_prism routine is called 10 times. But the number_of_strings is usually in thousands, so, my program takes lot of time to complete. Let me know if you need more information. By the way I tried with subprocess, too. Thanks.

    Read the article

  • Fastest method for SQL Server inserts, updates, selects

    - by Ian
    I use SPs and this isn't an SP vs code-behind "Build your SQL command" question. I'm looking for a high-throughput method for a backend app that handles many small transactions. I use SQLDataReader for most of the returns since forward only works in most cases for me. I've seen it done many ways, and used most of them myself. Methods that define and accept the stored procedure parameters as parameters themselves and build using cmd.Parameters.Add (with or without specifying the DB value type and/or length) Assembling your SP params and their values into an array or hashtable, then passing to a more abstract method that parses the collection and then runs cmd.Parameters.Add Classes that represent tables, initializing the class upon need, setting the public properties that represent the table fields, and calling methods like Save, Load, etc I'm sure there are others I've seen but can't think of at the moment as well. I'm open to all suggestions.

    Read the article

  • how i insert values from list of Data Grid View,current time ,EmployeeID using button click event (C

    - by Six fourty
    hi, it show me this error Incorrect syntax near the keyword 'Select' to make to clear Employee ID in this case is FK in the table (Attendance detail) and the other thing is i am using Data Grid View from another table(Employee information) to Show the list of the staff in my form. then i want to transfer each selected cell value from Data Grid View to attendance detail table. 10q private void time_in_Click(object sender, EventArgs e) { employee_InformationDataGridView.SelectedCells[0].Style.ForeColor = Color.Green; time_in.Enabled = false; time_out.Enabled = true; con = new SqlConnection(GlobalClass.conn); con.Open(); SqlCommand cmd = new SqlCommand("Insert into Attendancedetail Values(" + "Select from EmployeeInformation(EmployeeID)" + ",'" + employee_InformationDataGridView.SelectedCells[0] + "','" + DateTime.Now.ToLongDateString() + "','" + null + "','" + null + "','" + DateTime.Now.ToLongTimeString() + "'," + null + ")", con); int i = cmd.ExecuteNonQuery(); MessageBox.Show(i.ToString() + " record inserted"); }

    Read the article

  • Command line does not execute my parameters

    - by darnpunk
    I have created a batch file to run an application automatically but it seems my CMD does not run it. I typed this (using notepad as an example): CMD /C "C:\notepad2\notepad2.exe" If I run this from Windows Vista it worked. But running this from Windows Server 2008 (64-bit) it just doesn't work. I even try using that line from the Run menu but no go. What do I do? My aim is to run a scheduled task that runs the batch file every now and then.

    Read the article

  • MySQL null/empty-string too long for VarChar(5) ?

    - by rlb.usa
    I have a stored procedure that takes an input var_zip varchar(5). My webapp calls this procedure and gives it the parameter: cmd.Parameters.Add(new MySqlParameter("var_Zip", MySqlDbType.VarChar, 5)); cmd.Parameters["var_Zip"].Value = txtZip.Text; txtZip is empty. So it is either giving empty string '', or null. Doesn't matter to me which. But it is throwing an error: MySql.Data.MySqlClient.MySqlException: Data too long for column 'var_Zip' at row 1 What's going on and how can I fix it? I don't understand.

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >