Search Results

Search found 8 results on 1 pages for 'mobin'.

Page 1/1 | 1 

  • How to open Microsoft Word by function call?

    - by Mobin
    I want to open a word document through my program in C# and document path to read or write to. 2.To change the formatting of text in the word document as if i wanted the word window to give me the text in RTF format or plain text or docx (supported formats) 3.If i can retrieve the text in my given format such as RTF from the word window as the user closes the word window

    Read the article

  • Saving and retrieving image in SQL database from C# problem

    - by Mobin
    I used this code for inserting records in a person table in my DB System.IO.MemoryStream ms = new System.IO.MemoryStream(); Image img = Image_Box.Image; img.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); this.personTableAdapter1.Insert(NIC_Box.Text.Trim(), Application_Box.Text.Trim(), Name_Box.Text.Trim(), Father_Name_Box.Text.Trim(), DOB_TimePicker.Value.Date, Address_Box.Text.Trim(), City_Box.Text.Trim(), Country_Box.Text.Trim(), ms.GetBuffer()); but when i retrieve this with this code byte[] image = (byte[])Person_On_Application.Rows[0][8]; MemoryStream Stream = new MemoryStream(); Stream.Write(image, 0, image.Length); Bitmap Display_Picture = new Bitmap(Stream); Image_Box.Image = Display_Picture; it works perfectly fine but if i update this with my own generated Query like System.IO.MemoryStream ms = new System.IO.MemoryStream(); Image img = Image_Box.Image; img.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); Query = "UPDATE Person SET Person_Image ='"+ms.GetBuffer()+"' WHERE (Person_NIC = '"+NIC_Box.Text.Trim()+"')"; the next time i use the same code for retrieving the image and displaying it as used above . Program throws an exception

    Read the article

  • Can anyone telme whats wrong in this part of code

    - by Mobin
    string name = ((DateTimePicker)sender).Name.ToString(); name = name.Substring(0, name.Length - 1); name = name + "4"; TimeSpan duration = new TimeSpan(); duration = ((DateTimePicker)sender).Value - ((DateTimePicker)panel2.Controls[name]).Value; name = name.Substring(0, name.Length - 1); name = name + "6"; ((MaskedTextBox)panel2.Controls[name]).Text = duration.ToString(); on execution it gives me Object reference not set to instance of an object similar functionality is used on other places but can't find out what i have to reinitialize here :$

    Read the article

  • How to Update the primary key of table which is referenced as foreign key in another table?

    - by Mobin
    Suppose a Table "Person" having columns "SSN","Name","Address" and another Table "Contacts" having "Contact_ID","Contact_Type","SSN"(primary key of Person) similarly Table "Records" having "Record_ID","Record_Type","SSN"(primary key of Person) Now i want that when i change or update SSN in person table that accordingly changes in other 2 tables. If anyone can help me with a trigger for that Or how to pass foreign key constraints for tables

    Read the article

  • Can anyone tell me what's wrong in this part of code

    - by Mobin
    string name = ((DateTimePicker)sender).Name.ToString(); name = name.Substring(0, name.Length - 1); name = name + "4"; TimeSpan duration = new TimeSpan(); duration = ((DateTimePicker)sender).Value - ((DateTimePicker)panel2.Controls[name]).Value; name = name.Substring(0, name.Length - 1); name = name + "6"; ((MaskedTextBox)panel2.Controls[name]).Text = duration.ToString(); On execution it gives me Object reference not set to instance of an object similar functionality is used on other places but I can't find out what I have to reinitialize here :$ The casting for datetimepicker is fine I have to get a name for the datetiempicker to identify the row it's on in my form and the picker before that to calculate their differences and then print that difference in a maskedtext box from the control whose name I make using names of two datetimepickers but when I access controls in the error line I get this message.

    Read the article

1