Search Results

Search found 19 results on 1 pages for 'dansogaard'.

Page 1/1 | 1 

  • How to Edit rows in DataGridView?

    - by DanSogaard
    So I've a button on my frmMain that opens up another frmEdit which has a datagridview that displays the following query: BindingSource bs = new BindingSource(); string sqlqry = "select p_Name from Items where p_Id=" + p_Id; SqlCeCommand cmd = new SqlCeCommand(sqlqry1, conn); SqlCeDataReader rdr = cmd.ExecuteReader(); bs.DataSource = rdr; dataGridView1.DataSource = bs; this.ShowDialog(parent); Now when frmEdit loads up the dgv displays the query just fine, but I can't Edit. I tried dgv.BeginEdit(true), but it doesn't work. The EditMode works fine if I used wizard to bind datasources to the dgv, but I need to execute my own customized queries and be able to update them directly.

    Read the article

  • Help with connection string

    - by DanSogaard
    So I'm trying to connect to my database at the specified location, and the connection is established as long as the db at the same location specified at DataSource field, but what if I tried to distribute my application, the file path will change and will lead to errors I want to avoid. Here is my connstring: string connstring = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\PC1\Documents\Visual Studio 2008\Projects\Test\Test\bin\Debug\MyDatabase01.accdb;Persist Security Info=true"; Is there anyway I can define DataSource location to be at the same folder?.

    Read the article

  • Error: Specified method is not supported?!!

    - by DanSogaard
    I keep getting this error when I try to call Find() public void findTxt(string text) { BindingSource src = new BindingSource(); src.DataSource = dataGridView1.DataSource; src.Position = src.Find("p_Name", text); // Specified method is not supported if (src.Position == 0 && dataGridView1.Rows[0].Cells[2].Value.ToString() == text) { MessageBox.Show("Item found!!"); dataGridView1.CurrentCell = dataGridView1.Rows[src.Position].Cells[2]; } else if (src.Position == 0 && dataGridView1.Rows[0].Cells[2].Value.ToString() != text) { MessageBox.Show("Item not found!!"); } else { MessageBox.Show("Item found!!"); dataGridView1.CurrentCell = dataGridView1.Rows[src.Position].Cells[2]; } }

    Read the article

  • C# Application self-destroy at specific date

    - by DanSogaard
    Is there anyway I can use to destroy my deployed application at specific date?. How can I order the application to destroy itself at specific date after installation?. Say I deployed my C# application at PC1 today. After a specific date the application is deleted and removed off PC1 automatically (Installation folder removed). How can I do that?. If this is not possible, at least how can I prevent the user from using it anymore after specific date?.

    Read the article

  • How to edit datagridview using SqlCeDataAdapter?

    - by DanSogaard
    I've a frmEdit with datagridview that's bouned to this: string sqlqry1 = "select p_Name from Items where p_Id=" + p_Id; using (SqlCeDataAdapter a = new SqlCeDataAdapter(sqlqry1, conn)) { DataTable dt1 = new DataTable(); a.Fill(dt1); dataGridView1.DataSource = dt1; } How to edit cells and save them back to the db?, tried using this: using (SqlCeDataAdapter a = new SqlCeDataAdapter(sqlqry1, conn)) { DataTable dt1 = new DataTable(); a.Fill(dt1); dataGridView1.DataSource = dt1; a.Update(dt1); } Nothing. Is there anyway?.

    Read the article

  • Web Part to Update a List Data in SharePoint

    - by DanSogaard
    I'm trying to write a web part that access lists and add items in a specific list. The user modifies the web part and type in List Name, the web part has 3 TextBoxs and a Button. The user should enter data and press the save button, that should update the list and add these data in a new record. I'm using the following code to build my web part, but the save button doesn't update the list. I don't know what's wrong it just reload the page and add nothing. Edit: BTW the list am trying to update has three columns, First Name, Last Name, and Email, respectively. using System; using System.Web; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Collections.Generic; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Utilities; using Microsoft.SharePoint.WebControls; using Microsoft.SharePoint.WebPartPages; using Microsoft.SharePoint.Security; namespace TimeSheetEntry { public class TimesheetEntry : System.Web.UI.WebControls.WebParts.WebPart { public TimesheetEntry() { } protected TextBox txtFirstName; protected TextBox txtLastName; protected TextBox txtEmail; protected Button btnSave; protected string listName = string.Empty; [WebBrowsable(true), WebDisplayName("List Name"), WebDescription("Enter List Name"), Personalizable(PersonalizationScope.User)] public string LN { get { return this.listName; } set { this.listName = value; } } protected override void CreateChildControls() { //initialize textboxes txtFirstName = new TextBox(); txtLastName = new TextBox(); txtEmail = new TextBox(); //initialize button btnSave = new Button(); btnSave.Text = "Save"; btnSave.Click += new EventHandler(btnSave_Click); } protected override void Render(System.Web.UI.HtmlTextWriter writer) { writer.Write("<table width=100%>"); writer.Write("<tr>"); writer.Write("<td colspan=2>"); writer.Write("</td>"); writer.Write("</tr>"); writer.Write("<tr>"); writer.Write("<td>First:<span class=’ms-formvalidation’>*</span></td>"); writer.Write("<td>"); txtFirstName.RenderControl(writer); writer.Write("</td>"); writer.Write("</tr>"); writer.Write("<tr>"); writer.Write("<td>Last Name:<span class=’ms-formvalidation’>*</span></td>"); writer.Write("<td>"); txtLastName.RenderControl(writer); writer.Write("</td>"); writer.Write("</tr>"); writer.Write("<tr>"); writer.Write("<td>Email:<span class=’ms-formvalidation’>*</span></td>"); writer.Write("<td>"); txtEmail.RenderControl(writer); writer.Write("</td>"); writer.Write("</tr>"); writer.Write("<tr>"); writer.Write("<td>"); writer.Write("</td>"); writer.Write("<td>"); btnSave.RenderControl(writer); writer.Write("</td>"); writer.Write("</tr>"); writer.Write("</table>"); } public void btnSave_Click(object sender, EventArgs e) { SPWeb web = SPContext.Current.Web; SPList timesheetList = web.Lists[this.listName]; SPListItem newTimesheetEntry = timesheetList.Items.Add(); newTimesheetEntry["First Name"] = txtFirstName.Text; newTimesheetEntry["Last Name"] = txtLastName.Text; newTimesheetEntry["Email"] = txtEmail.Text; newTimesheetEntry.Update(); timesheetList.Update(); } } }

    Read the article

  • How to disable edit mode on cells but checkbox column?

    - by DanSogaard
    My checkbox column doesn't respond when ticked, apparently it was set to read only, so changing state back to false again will make it possible to tick. However, that will turn the whole edit mode to true. I tried to set edit mode to programatically while setting ReadOnly mode to false, but that will disable the checkbox back again. How can I disable edit mode on all cells except checkbox column?

    Read the article

  • How to Edit Permission on "Create" in MOSS07?

    - by DanSogaard
    When you go to Lists, and Create. I'd like to show the "Custom Lists" column only to specific group. I don't want the users to be able to create Web Pages, Document Libs .. etc But I'm not able to see how, I tried to create a custom group and edit permission level, but I cant find where exactly. does enabling "Create" to specific group opens all settings inside that you can't eliminate certain settings from showing to this group?.

    Read the article

  • How to hide Lists from specific group?

    - by DanSogaard
    How to hide Lists from specific group, but at the same time allow them to add items in it?. I edited permission levels for the site and created a permission that has these privileges: List Permissions: Add Items, View Items. Site Permissions: View Pages, Open. And then assign this permission to the group along with View Only. However this would still show Lists and the users are able to access them. How can I hide it from this specific group only?.

    Read the article

  • How to Edit Permission on "Create"? SharePoint

    - by DanSogaard
    When you go to Lists, and Create. I'd like to show the "Custom Lists" column only to specific group. I don't want the users to be able to create Web Pages, Document Libs .. etc But I'm not able to see how, I tried to create a custom group and edit permission level, but I cant find where exactly. does enabling "Create" to specific group opens all settings inside that you can't eliminate certain settings from showing to this group?.

    Read the article

  • Help with Report Viewer

    - by DanSogaard
    My Items table contains items with each item has a specific date. I want to generate a report that displays items between two different dates. For example, I'd put two timedatepicker controls so the user selects From: 24/9/2009 To: 19/3/2010 and then press a button to generate a report of items between these dates. I'm using Report Viewer control btw not crystal report.

    Read the article

  • How to generate unique number of 12 digits?

    - by DanSogaard
    I'm working on an app that sends raw data to zebra printer and print out barcodes. And since every item has its own unique barcode, I need to define a variable that automatically generates unique number of 12 digits long. see example: printBar prnt = new printBar("123456789012"); Is there anyway to define a double variable and pass it to a function that return uniqely 12 digits number and pass it over again to the printBar class?. But how to make sure everytime you access it returns a unique value?. I also thought of another way, since am using MS Access db, I can create a column of AutoNumber datatype and assign it to Random, but you don't get the exact 12 digits required, sometimes it generates a value of 10 digits sometimes more or less.

    Read the article

  • Help with SQL query in C#

    - by DanSogaard
    I'm trying to rename the columns. The syntax should be the column name between double quotes incase of two words, like this: SELECT p_Name "Product Name" from items So I'm trying to do it in C# code like this: string sqlqry1 = "SELECT p_Name \"Prodcut Name\" from items"; But I get an error: Syntax error (missing operator) in query expression 'p_Name "Prodcut Name"'. It seems am having somthing wrong with the quotes, but I can't figure out.

    Read the article

1