C Sharp :: Unable To Successfully Submit List Of Authors From Listbox
Jan 17, 2014
I need to add either one author or a list or array of authors to my sql table. Here is the code that is used to insert the authors into the table:
The code from the listbox:
<asp:ListBox runat="server" ID="AuthorList" DataTextField="AuthorName"
DataValueField="AuthorName" DataSourceID="Authors" SelectionMode="Multiple"/>
Datasource code:
<asp:ObjectDataSource runat="server" ID="ds_InventoriedAuthors"
SelectMethod="GetAuthors" TypeName="CntyLibrary.Inventory.Authors" InsertMethod="AddAuthors">
<InsertParameters>
<asp:QueryStringParameter Name="AuthorID" Type="Int32" QueryStringField="id" />
[Code] ....
View 3 Replies
ADVERTISEMENT
Jan 12, 2015
In my MainWindow I have a UserControl called CamAccessLevel1. This will be one of a few different UserControls which will have more and more functionality to a device as the Level goes up.
Each of those functionalities are themselves a UserControl, so that I don't have to keep remaking them for each different "Level" that I make.
So... I have a UserControl in a UserControl in my Mainwindow. My first goal is to have a button in one of those sections send an event back to the MainWindow to close the application. This sections is called "ProgramControl", as it has functions that relate to the program itself.
I can't seem to set a datacontext within another datacontext -> There is an error in UIViewModel below...
Note that I have replaced my company name with [snip]
In my Mainwindow.xaml
<views:CamAccessLevel1 x:Name="UserInterface"/>
Mainwindow.xaml.cs
public partial class MainWindow : Window {
#region MyModel
[code]....
View 10 Replies
View Related
Nov 26, 2013
I have a submit button, where users are clicking after entering text into textboxes and (hopefully) check boxes (for yes/no).
Here is my code, and when I run it and press submit, there is no action. It just continues to loo.
string ConnectionString = @"Data Source=.SQLEXPRESS;
AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True";
using (SqlConnection dataConnection = new SqlConnection(ConnectionString)) {
using (SqlCommand dataCommand = dataConnection.CreateCommand())
[Code] .....
Note: I took out the Checkboxes in the code to hopefully get a successful run, to no avail.
View 3 Replies
View Related
Jun 28, 2014
I started learning programming a few days ago and i'm having trouble with reading each line from a listbox this is the code i'm having trouble with
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public string[] getFlies
{
get;
set;
[Code]....
What am I doing wrong?
View 5 Replies
View Related
Mar 31, 2013
What codes in c# will output items in a list box?
View 2 Replies
View Related
Oct 4, 2012
How to display the item in listbox,which are selected from three combobox.
View 1 Replies
View Related
Apr 4, 2013
I want to set the rootpath of an executable application. This rootpath should be the same as the path of an item that I select from a ListBox. The code for selecting the item is as follows.
namespace Menu {
public partial class Form1 : Form {
private Button button;
private ListBox listBox1;
private string selecteditem;
[Code] ....
Now what I want is: Whatever I get the output as in the :
Console.Writeline(path + selecteditem),
I would want to set this as a rootpath for an application so as to do rest of the measurements or steps only in that path/folder. Is it possible to do something like this?
View 8 Replies
View Related
Apr 9, 2014
i have a program that is a Mediastore and i have 4 classes. Produkt: which is a class with a few variables that i use to add products to my List.
public class produkt
{
public string Name;
public string price;
[Code]....
then i have my Lager class which i use to add my products to my list and Listbox. This is done by having 3 textfields where i say what the Name,SerialNumber and Price of the object i created should have.
In this class i also have 2 more textfields and a button that make it possible to add a quantity of the selected listbox object of my product Class. if the item im trying to add a quantity to dosent exist i get a question if i wanna add that product and it adds that product to the list. if however the product allready exist its suposed to add the quantity with the selected amount from my textbox.
Then I have my Class Kassa which is a Form with 2 Listboxes. The first listbox share the same List as the one in my Lager class and the other listbox is the listbox which i use to take items from my produktlist and put it in my checkout "basket" then i am suposed to be able to choose one of these items from my checkout basket put the amount i want of that item into a textfield called KvantLEv and press the checkout button to be able to simulate a checkout and then this selected item's quantity is suposed to be lowerd by the specified amount and is to be removed from the checkoutlistbox but this aint working... this is my checkout function so far
private void cashout()
{
produkt p = new produkt();
int a = VaruKorg.Items.Count - 1;
[Code]....
View 7 Replies
View Related
Oct 17, 2014
I am trying to get my service to install into services but it will not. When I go to the command line and run the InstallUtil.exe service.exe it fails miserably. This is what I get on my console:
The Install phase completed successfully, and the Commit phase is beginning.
See the contents of the log file for the C:publish codeImportImport. exe assembly's progress.
The file is located at C:publish codeImportImport.InstallLog.
Committing assembly 'C:publish codeImportImport.exe'.
Affected parameters are:
logtoconsole = true
logfile = C:publish codeImportImport.InstallLog
assemblypath = C:publish codeImportImport.exe
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C: publish codeImportImport.exe assembly.
Remove InstallState file because there are no installers.
The Commit phase completed successfully.
The transacted install has completed.enter code here
View 2 Replies
View Related
Sep 11, 2014
Okay so i have everything right accept transfering the selectedindex from listbox in form1 to listbox in form2. I am using the below string item to hold the selected line of the list box, with the intent of recalling and then adding it into the form2 listbox. I get a not implemented error and i can't figure out why. I know the information is moving with the variable item, it just doesn't get printed out to the new listbox.
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string item = listBox1.SelectedItem.ToString();
Form2 form2 = new Form2();
form2.Show(item.ToString());
[Code]....
View 13 Replies
View Related
Mar 24, 2013
actually it is the windows application .When i'm running my program it is not allowing me to enter the data into textboxes means the cursor is not appearing
View 1 Replies
View Related
Dec 7, 2012
I am trying to change label text on button click, the way label.text = "string" work well before but not in this case. I tried to put this on other method and it work..it is just not working on the button that I would like to fire..
C# code :
protected void btnTotalGroupMember_Click(object sender, EventArgs e) {
string s = "there";
string[] words = s.Split(' ');
foreach (string word in words) {
Label1.Text = s;
[Code] ...
View 4 Replies
View Related
Mar 3, 2015
how would i access the list created,i should be able to access the list from all other class, adding to it update ect ect.
class test2
{
public string FirstName{ set; get; }
public string LastName { set; get; }
public string Location{ set; get; }
private List<test2> myList = new List<test2>();
public override string ToString()
[code]....
now in a seperate class how would i view the item (print in console) and edit 'mike' location to XYZ.
View 6 Replies
View Related
Sep 15, 2014
I've been trying to read a .txt into a linked list in the attached code. I'm running into problems, specifically I'm getting errors on line 41 (curr->word=charTemp. I'm trying to set the word array equal to the charTemp array. I've tried strcpy with no luck .
Code:
#include <stdio.h>#include <stdlib.h>
#include <string.h>
//Struct for linked list
typedef struct node {
char word[25];
struct node *next;
} node;
[Code]...
View 2 Replies
View Related
Apr 14, 2014
I'm having a problem trying to modify my patient's data. It seems to work, but once the block of code ends it does not save to the linked list.
Problem located in case M.
linked list template header: [URL] ...
patient header: [URL] ...
patient implementation: [URL] ...
#include <iostream>
#include "listTemplate.h"
#include "PatientRecord.h"
using namespace std;
char menu() {
char input
[Code]...
View 1 Replies
View Related
Aug 22, 2014
I am trying this without a head/start pointer which would generally hold the address of first node. I have 3 nodes here from which I am trying to delete last node, but its not happening. I might be wrong in my logic and this is my first linked list program.
#include <stdio.h>
#include <stdlib.h>
struct dll{
struct dll *prev;
int data;
struct dll *next;
[Code] ....
output::::
add of p1::0x9605008 add of p2::0x9605018 add of p3::0x9605028 add of p1->prev::(nil) add of p1->next::0x9605018 add of p2->prev::0x9605008 add of p2->next::0x9605028 add of p3->prev::0x9605018 add of p3->next::(nil)
no of nodes 3
enter the addresss of node to delete it
0x9605028
after deletion attempted
add of p1::0x9605028 add of p2::0x9605018 add of p3::0x9605028 add of p1->prev::0x9605018 add of p1->next::(nil) add of p2->prev::0x9605008 add of p2->next::0x9605028 add of p3->prev::0x9605018 add of p3->next::(nil)
no of nodes 3
In this example i am trying to delete the node 3 which is p3, by deleting its address 0x9605028. But after deletion the node count is still 3 and addresses are like unexpected!
View 1 Replies
View Related
Feb 17, 2013
//#include "stdafx.h"
#include<iostream>
#include<cmath>
using namespace std;
//class declaration
class dayType{
public: int presday;
[Code] ....
So everything works perfectly, well not everything lol. Code compiles successfully without any errors but previous day does not calculate. In a sense that when it asks for number of previous days it returns a blank statement.
For example: Previous number day is: shows nothing
View 2 Replies
View Related
Feb 5, 2015
So I'm making my first program w/ C++ and its a game guessing game. I've learned how to use booleans, chars, strings, if/else, loops, and input. Anything past that I dont know. I've gotten my game to work properly except for the fact that when you guess incorrectly, the program closes. I want the program to go to the beginning of the program again so the user can restart. So far i've gotten the loop to beginning thing to work but not well. It'll only repeat twice before closing again and it'll say the user got the wrong answer even if it was correct. Here's my code
#include <iostream>
#include <string>
#include <random>
#include<ctime>
using namespace std;
int game(){
string playerName;
int guess;
[Code] ....
View 1 Replies
View Related
Feb 11, 2013
I'm using MSVC++ and it builds sucessfully but somewhere something is obviously messed it. Once i try to debug it just shows weird numbers.
int k=0; //could this be the problem??? since 0 would be over writing any given value. but if i leave int k; it showsa warning and MSVC would count that as an error
#include "stdafx.h" //Header file section
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
//structure declaration
struct menuitemtype
[Code] ......
View 14 Replies
View Related
Feb 16, 2013
<asp:TemplateField HeaderText="Group_Id">
<ItemTemplate> <asp:Label ID="G1" runat="server" Text='<%# Eval("Group_Id") %>'></asp:Label>
</ItemTemplate> <EditItemTemplate> <asp:TextBox ID="G2" runat="server" Text='<%# Eval("Group_Id")
[Code] ....
on running i find this error
Compiler Error Message: CS1061: 'ASP.webform12_aspx' does not contain a definition for 'Group_Item_Name_SelectedIndexChanged' and no extension method 'Group_Item_Name_SelectedIndexChanged' accepting a first argument of type 'ASP.webform12_aspx' could be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 143: </EditItemTemplate>
Line 144: <FooterTemplate>
Line 145: DropDownList ID="G3" runat="server" AutoPostBack="True"
Line 146: onSelectedIndexChanged=" Group_Item_Name_SelectedIndexChanged" Width="133px">
Line 147:</asp:DropDownList>
View 1 Replies
View Related
May 27, 2012
I have a txt file of drinks, and I want to meak a list of buttons of it (the txt file is build like this: fanta : 2 ), how can I make buttons of all the drinks ( I get the first one in a button , but not the others).
Dictionary<string, double> drank = new Dictionary<string, double>();
string[] words = new string[8];
Button button;
<Button> BtnList = new List<Button>();
[Code] ....
View 1 Replies
View Related
Mar 16, 2013
I am need to compare 2 items from 2 separate drop down lists. These values are of int type. Say for example 2 drop down lists showing years. Now i need to find out these 2 years selected is greater or nearer to the current year.
I tried converting the values i receive from the drop down lists to int variables. But i am getting error then. I gave it like below.
int tmp = Convert.ToInt32(ddl_1.SelectedItem.Text);
this gives an error like this - Input string was not in correct format.
I need to know how to put an item from a drop down list to a variable of int data type.
View 1 Replies
View Related
Aug 27, 2014
I am trying to query an Informix database using a List<T> collection's elements as variables. I can build the list and connect to the database, but I am unsure how to iterate through the list and query the database for each item in the collection.
My list is of type string, and contains Order Numbers. I want to query item information for each order number in the list.
View 1 Replies
View Related
Jun 23, 2012
//////////////////////////////////////////////
struct FaceTemplate {
public byte [] templateData;
}
List <FaceTemplate> faceTemplates;
////////////////////////////////////////////
I want to create this structure as globally to access this list in every window form. how can i create and how cam i access.
View 1 Replies
View Related
Oct 6, 2012
I want to display the content of my database in list view. The table has 5 columns however when I tried this code
string view = "Select * from cust_infor";
SqlCommand cmd = new SqlCommand(view,FL.clsconnection.opencon());
SqlDataReader dr = cmd.ExecuteReader();
listView1.Items.Clear();
while (dr.Read()) {
listView1.Items.Add(dr[0].ToString()).SubItems.Add(dr[1].ToString());
}
It limits the display to 2 columns. List view will only show the first 2 columns. The code above won't let me add more indexes or subitems. Only up to 2 columns.
View 1 Replies
View Related
Aug 19, 2012
I am grabbing data from three entities and want to grab a field value in each of the entites and place it in an arraylist. What I would like to do is loop through the arraylist for all the values and do something for each value only once. If the value in the array list is repeated, I want to not do anything for it and continue till the end. Basically, I loop through all the values do something for each value and skip over the repeated value if I already did something.
View 1 Replies
View Related