parameters

How to use SQL parameters with NpgsqlDataAdapter?

别等时光非礼了梦想. 提交于 2019-12-20 06:46:53
问题 Is it possible to use parameters together with NpgsqlDataAdapter, as I can do with NpgsqlCommand: string sql = "SELECT * FROM tbl_student WHERE name = @val"; NpgsqlCommand command = new NpgsqlCommand(sql, conn); command.Parameters.AddWithValue("@val", name); I have this code, which displays the information about the students i a gridview: string sql = "SELECT * FROM tbl_student WHERE studentname = '" + name + "'"; DataSet ds = new DataSet(); DataTable dt = new DataTable(); NpgsqlDataAdapter

How to access data from another datatemplate in wpf?

旧巷老猫 提交于 2019-12-20 06:37:21
问题 I have 2 Datatemplates. One contain a grid , second one contain a button. I need to send command parameters of button as selected grid items. How can i do this ? <ObjectDataProvider x:Key="Datas" ObjectType="{x:Type ViewModel:UserControlViewModel}"></ObjectDataProvider> <DataTemplate x:Key="SourceGrid"> <WPFToolKit:DataGrid x:Name="SourceDataGrid" ItemsSource="{Binding Source={StaticResource Datas},Path=SourceGridData}" CanUserSortColumns="True" GridLinesVisibility="None"

Elegant way to handle Keyboard Input in JavaFX

梦想与她 提交于 2019-12-20 06:05:19
问题 I am currently working on a calculator in JavaFX and right now trying to implement keyboard input support. For this I am trying to implement an EventHandler in the main .java file like this: @Override public void start(Stage stage) throws Exception { Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml")); Scene scene_main = new Scene(root); stage.setScene(scene_main); stage.show(); scene_main.setOnKeyPressed(new EventHandler<KeyEvent>() { @Override public void handle

Android Root execute su with parameters

放肆的年华 提交于 2019-12-20 05:38:05
问题 I ve got a problem, executing su with parameters (containing blank space?!). My Command.java looks like this: public class Command { Process process; public String executeCommand(String command) { StringBuffer output = new StringBuffer(); try { process = Runtime.getRuntime().exec(command); process.waitFor(); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); String line = ""; while ((line = reader.readLine())!= null) { output.append(line + "\n"); } }

What is the difference between ${var:-word} and ${var-word}?

陌路散爱 提交于 2019-12-20 05:18:11
问题 I found the following command in a bash script: git blame $NOT_WHITESPACE --line-porcelain "${2-@}" -- "$file" What does this ${2-@} mean? Trying out, it returns the 2nd argument, and "@" if it doesn't exist. According to the documentation, ${2:-@} should do the same. I tried it, and it indeed does the same. What's the difference? Where is it documented? The man page does not seem to say anything about this notation. 回答1: From Bash hackers wiki - parameter expansion: ${PARAMETER:-WORD} $

JMeter: How to know why my regular expression extractor in JMeter is not extracting the data

元气小坏坏 提交于 2019-12-20 04:55:37
问题 I would like to know why regular expression extractor in JMeter is not extracting the data after parameterization. Response message: Internal Server Error Expression added are: name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="(.+?)" name="__VIEWSTATE" id="__VIEWSTATE" value="(.+?)" POST data: __VIEWSTATE=%24%7BviewState%7D&__EVENTVALIDATION=%24%7BeventValidation%7D&txtUserID=1001201&txtPWD=CFL&BtnSubmit=Submit&hdnE=5&hdnN=323&hdnD=173 回答1: Your regexp is probably wrong. To debug it, run

Passing arguments form java program to bash script that call another java programa with the arguments

℡╲_俬逩灬. 提交于 2019-12-20 04:53:32
问题 I want to executing a shell scripting in my java program passing a argument showed bellow: Runtime.getRuntime().exec("./test.sh " + "\\\"param1\\\"\\\"param2\\\"\\\"param3\\\""); And the test.sh will call another java program passing the string argument like this: another.jar \"param1\"\"param2\"\"param3\" and finally the program anther.jar will interpret the argument in this format another.jar "param1""param2""param3" I'm a bit confuse with this bacause I can't deal correctly with escapes

Passing arguments form java program to bash script that call another java programa with the arguments

北城余情 提交于 2019-12-20 04:53:12
问题 I want to executing a shell scripting in my java program passing a argument showed bellow: Runtime.getRuntime().exec("./test.sh " + "\\\"param1\\\"\\\"param2\\\"\\\"param3\\\""); And the test.sh will call another java program passing the string argument like this: another.jar \"param1\"\"param2\"\"param3\" and finally the program anther.jar will interpret the argument in this format another.jar "param1""param2""param3" I'm a bit confuse with this bacause I can't deal correctly with escapes

What happens to a parameter passed by value that is modified locally?

元气小坏坏 提交于 2019-12-20 04:50:31
问题 I am well aware that modifying a function's argument that is passed by value is ineffective outside of the C/C++ function, but compilers allow it - but what happens? Is a local copy made of the argument and that is modifiable within the function? #include <stdio.h> void doSomething( int x ) { x = 42; printf( "The answer to Life, the Universe and Everything is (always): %i!\n", x ); } int main( int argc, char **argv ) { int a = 0; doSomething( a ); return -a; } Now this always exits without

Running an exe file with parameters in a VBScript

拜拜、爱过 提交于 2019-12-20 04:26:30
问题 I need to create a script that runs setup.exe /configure Install.xml from the folder the script is located. When I run the script below, it does find the setup.exe but it does not read the parameters. It is like the last part ( /configure Install.xml ) is not being read. Script: Set objShell = CreateObject("Wscript.Shell") strPath = Wscript.ScriptFullName Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.GetFile(strPath) strFolder = objFSO.GetParentFolderName