|
hi
thanks for u r reply
but i m not storing the image in any file.
i have a blank image name "Image1.jpg"
i m calling this blank image and storing in img object
and in drawing lines on this image object using graphics
now i want add img to a table in a new row
it is showing error cannot convert to byte
|
|
|
|
|
Iam having values in datatable
datatable is having id's like 80,84,86
dtsecondlstbox-->datatable name
lstSelected.DataSource = dtsecondlstbox;
how to sort datatable values....
can anyone help me
|
|
|
|
|
//your question is already answered, The only way to sort datatable is to use dataview
DataView dv = new DataView(dtsecondlstbox, null, "Id", DataViewRowState.CurrentRows);
dtsecondlstbox= dv.ToTable();
lstSelected.DataSource = dtsecondlstbox;
|
|
|
|
|
DataView dv = new DataView(dtsecondlstbox, null, "Id", DataViewRowState.CurrentRows);
iam binding listbox not datagrid.
for listbox can u tell me
|
|
|
|
|
ListBox has Sorted property.
|
|
|
|
|
DataView dv = new DataView();
dv = dtCompanyForm.DefaultView;
dv.Sort = "ID";
dtCompanyForm.DefaultView = dv;
then also getting error like "Property or indexer 'system.data.datatable.defaultview'cannot be assigned to--it is read only".
|
|
|
|
|
DataView dv = new DataView(dt, "", "id", DataViewRowState.CurrentRows);
dt = dv.ToTable();
listBox1.DataSource = dt;
listBox1.DisplayMember = "name";
listBox1.ValueMember = "id";
|
|
|
|
|
|
DataView dv = new DataView();
dv = dtCompanyForm.DefaultView;
dv.Sort = "ID";
dtCompanyForm.DefaultView = dv;
then also getting error like "Property or indexer 'system.data.datatable.defaultview'cannot be assigned to--it is read only".
can u help me
|
|
|
|
|
swetha_insoft wrote: then also getting error like "Property or indexer 'system.data.datatable.defaultview'cannot be assigned to--it is read only".
You didn't read the documentation
There is a no need to create a new DataView . Use the one you are getting from DataTable.DefaultView . You could write something like
yourDataTable.DefaultView.Sort = "id ASC"
Now bind using the DefaultView .
modified on Monday, June 29, 2009 2:30 AM
|
|
|
|
|
ya thank you very much.
it's working fine
|
|
|
|
|
i hav a project with a DLL (someone created this),
suppose in this project a form (frmmain) contain some textboxes, combobox and some button also as save,Edit, delete..
suppose record loaded by RecordID-
so he just call
objDLL.LoadRecord(this)
and record filled in text boxex and combobox, radio button
and clicking on save- programmer just call
objDLL.hndRecordSave(this); //// as form name is same frmMain
and record saved, record of textboxes, combo, radio, etc
similarly on edit he just call
objDLL.hndRecordUpdate(this);
and record updated.
i just wana to know at ceating dll how he manage all form in function and how he create this dll. and now i wana to implement it to add and remove some field according to requirement.
thanks hoping u all understand what i want to say.
|
|
|
|
|
ishika_kukki wrote: objDLL.LoadRecord(this)
ishika_kukki wrote: objDLL.hndRecordSave(this);
ishika_kukki wrote: objDLL.hndRecordUpdate(this);
This methods must be written somewhere in the dll and contain the actual code performing the operations.
In order to create a dll, create Class Library project.
|
|
|
|
|
thanks for replying
yes, this method is inside the dll, but how can we pass a control name (textbox, combo) when we creating a dll. as at calling the dll method he just pass the form object (this) and all control accessible inside the dll. how can we manage dll project and application project which using this dll.
|
|
|
|
|
See the "Controls" collection of a form.
If you pass the form to the DLL as you describe, it can iterate through the Controls collection to view all controls on the form.
foreach (Control c in this.Controls)
{
...
}
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
all the control uses by form have modifiers property set public. but how can we access a form inside code of dll, as dll is a seperate control project.
|
|
|
|
|
ishika_kukki wrote: all the control uses by form have modifiers property set public
IMO you are violating a lot of OOP concepts here.
ishika_kukki wrote: but how can we access a form inside code of dll
Isn't it the other way?
|
|
|
|
|
Hi Guys,
I have a requirement in which i have to create folders and few excel files based on the no of launches and users during runtime.
when i click "download" button, i will have info of no of launches and no of users , so based on no of launches it should create those many folders and based on no of users in each launch, those many excel files in each folder should be created.
launches 5. then 5 folders to be created with the name of each folder is the launch name
if in launch 1, users 6 => in Launch1 folder, 6 excel files with the file name as the user name to be created. ( i mean these excel files are not default files but i have a template for this, that template with the user name should be created for this.)
if in launch 2, users 19, in Launch2 folder, 19 excel files with the file name as the user name to be created.
all this should happen at runtime...
please help me doing this
thanks
ramm
|
|
|
|
|
for creating Folders:
//if you want to create multiple folders then use for loop.
System.IO.Directory.CreateDirectory(@"D:\\your folder name");
for creating Excel file:
Microsoft.Office.Interop.Excel.Application m_objExcel;
Microsoft.Office.Interop.Excel.Workbooks m_objBooks;
Microsoft.Office.Interop.Excel._Workbook m_objBook;
Microsoft.Office.Interop.Excel.Sheets m_objSheets;
Microsoft.Office.Interop.Excel._Worksheet m_objSheet;
Microsoft.Office.Interop.Excel._Worksheet m_objSheetIntro;
Microsoft.Office.Interop.Excel.Range m_objRange;
object m_objOpt = System.Reflection.Missing.Value;
m_objExcel = new Microsoft.Office.Interop.Excel.Application();
m_objBooks = (Microsoft.Office.Interop.Excel.Workbooks)m_objExcel.Workbooks;
//Opening the Excel Sheets.
m_objBook = (Microsoft.Office.Interop.Excel._Workbook)(m_objBooks.Add(m_objOpt));
m_objSheets = (Microsoft.Office.Interop.Excel.Sheets)m_objBook.Worksheets;
m_objSheet = (Microsoft.Office.Interop.Excel._Worksheet)(m_objSheets.get_Item(1));
//Store excel in folder
m_objBook.SaveAs(@your path name here + "\\your file name here.xls", m_objOpt, m_objOpt,
m_objOpt, m_objOpt, m_objOpt, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange,
m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt);
|
|
|
|
|
Hello Experts!!
I want to set password to my table in sqlserver2005.i dont knw how to set pwd to table.can anybody suggest me options? I am new with sql2005.
|
|
|
|
|
Hi,
Right Click on Table and go to the Properties.
In properties window, select permissions and it asks for users .
U can enter the user list for the permission grant.
Hope this works out.
Thanks
Ramm
|
|
|
|
|
KIDYA wrote: I want to set password to my table in sqlserver2005.i dont knw how to set pwd to table.can anybody suggest me options? I am new with sql2005
Wrong post... Any how, you can restrict access rights..
Database Name\Security\Logins
In logins you can search for that option...
|
|
|
|
|
Hello All,
I have to draw concentric circles in such a manner that even if the form is resized the circles are displayed in the center of the form. I tried using DrawEllipse but I don't get the desired effect.
Can someone help.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Have you hardcoded the parameters in the DrawEllipse method?
Following code works fine:
gx.Clear(this.BackColor);
gx = this.CreateGraphics();
gx.DrawEllipse(Pens.Red, (this.Width / 2 - 10), (this.Height / 2 - 10), 20, 20);
|
|
|
|
|
I don't hardcode the values. I get the center of the form and then try to draw the concentric circles
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|