|
VictorVB wrote:
but I don't want to use Blobs
Storing binary data in a databaser is usually done using some form of BLOB field, SQLServer has the Image datatype which would work... can I ask why you dont want to do this?
VictorVB wrote:
but the String is very-very long
I assume you've used Base64 encoding to turn the binary data to a string, again this will work but I dont think there is a way to reduce the length of the data.
The only advice I can give you is to store the path to the file in your database (No BLOB Field and no long string data), but thats not what you said you wanted to do.
|
|
|
|
|
Thank you.
My idea is to Convert Icon in to primitive type like String or other else and sore in database, I want primitive base type like String, Long...not blob.
I can Convert Icon into byte-array and to string but...is to much long .
|
|
|
|
|
The string representation of Binary data is inherantly quite a large number of characters. It needs to be to represent quite alot of data.
Have you looked at Convert.ToBase64String() ? Thats about the best string-representation you're likely to find.
|
|
|
|
|
hi friends,
how can i bypass the button event on certain conditions?
like i can in while() loop using break statement.
|
|
|
|
|
You can attach and detach the eventhandler. If you look at the "Windows Form Designer generated code" you can see how the connection between the event and the code is done.
If the code that should be triggered by the event is in button1_Click the code would be as follows:
private void AttachEventHandler()
{
this.button1.Click += new System.EventHandler(button1_Click);
}
private void DetachEventHandler()
{
this.button1.Click -= new System.EventHandler(button1_Click);
}
But why don't you just check the conditions using an if statement in the event code?
|
|
|
|
|
thanks for replying
i tried using
this.button1.Click -= new System.EventHandler(button1_Click);
inside the button_click event
but the next time i click the button nothing happens.
|
|
|
|
|
Ofcourse. My example detach the link between the event and the code. You will have to use the attach function to restore the link.
In .NET, the Event - Code relationship is not like in VB6. You can programmaticly set up what code to execute when an event is triggered. You can even add more than one function to be called. I assumed this was what you were trying to do. If this is not what you need, I think you should add an if statement in the button1_Click function that checks the conditions before executing the code.
|
|
|
|
|
actually i have a main form which calls the input form as modal. there is OK and cancel button on the input form. if the user presses cancel the form closes. if the user presses OK the software checks if all the inputs are correct. in the main form i am using the dialogresult property of the input form. i have set ok as dialogresult of the OK button. so irrespective ofthe validity of the inputs the input form returns the dislog result.
this is why i was trying to exit the buttonOk_click event if the inputs were not valid.
|
|
|
|
|
This can be solved very easily, without having to fiddle with button event handlers.
In your button event handler you could do something like this:
private void OKButton_Click(object sender, EventArgs e)
{
bool inputsOk = true;
if ( !inputsOk )
this.DialogResult = DialogResult.None;
else
{
this.DialogResult = DialogResult.Ok;
this.Close();
}
} That way the Dialog will stay open unless all inputs are valid.
mav
|
|
|
|
|
i had tried te same thing but it does not work.
in the ok button property i have set the dialog result property as none.
i have to press the OK button twice to assign the dialog result property to the button
|
|
|
|
|
Then you must have some other errors in your code.
The DialogResult property of your Button just determines the value of your Form 's DialogResult property when the button is pressed.
At the end of your button event handler, the dialog is closed if the Form 's DialogResult property is not DialogResult.None , simple as that.
If you don't want the dialog to close you have to set it's DialogResult to DialogResult.None .
So in my example, the call to this.Close(); is superfluous, but I wanted to show you where the dialog gets closed.
mav
|
|
|
|
|
Sorry my bad ... I think mav.northwind has provided the ideal example although there are ways to do it this example is ideal ... i didnt read it before i wrote the reply
Pushkar Pathak
|
|
|
|
|
U can overcome this by many ways
firstly make checks in the main form after the dialog result returned OK and if the validity check fails showdialog the input form again
otherwise to keep the main form free from the validity check mechanism
check in the button click event ... since a modal dialog is not destroyed until disposed raise a flag that says "Wrong INput" and let main form check this flag and show the main form again .....
or set the dialog result for the form and the button to none and set the dialogresult for the form in the event if the check is alright so that clicking the button doesnt close the form but u do programitically when reqd and that the main for sees only the dialog result for the form .. take a look at this
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskretrievingdialoginformation.asp[^]
Pushkar Pathak
|
|
|
|
|
Let's have a look at http://www.alachisoft.com/overview.htm [^]
This is a .NET code generator used for developing COM+ architechture.
Tier Developer uses it's own project have extension named *.tdvp. This file type can be understood by .NET and they work well with each other.
My question is: how to do this? How to write an aplication that can be embed to .NET environment?
|
|
|
|
|
|
Hello dear all
i am some bit problem that i wnat to delete mutirow in datagrid how i can delete it. i have search more it there is not one property in datagrid please help me
Priyank Gupta
|
|
|
|
|
A datagrid has a datasource, you must delete rows from there.
|
|
|
|
|
yes i know that but first i want know thata how many row select in datagrid
please tell me how do ou find that how many row select in datagrid there is nay propert that we can find it Please help me
thanks for reply
Priyank Gupta
|
|
|
|
|
I'm trying to do logarithmic curve fitting to plotted data points.
The equation is as follows:
y = a + b*ln(x)
The problem is that I have no clue how to compute the 'a' and 'b' coefficients.
Can anyone think back to scientific comp to remember how this is done?
Thanks
|
|
|
|
|
let u=ln(x)
then y = a + b*u
now use the method of least squares to find a and b.
Note: you are using the method of least squares to find y(u), so everywhere you would use x in least squares now use u(=ln(x)).
There are several good resources on the web. Google for 'Least squares' and 'logarithm'.
-Sean
----
Shag a Lizard
|
|
|
|
|
Hi, I'm working on a syntax-coloring textbox that inherits the RTB control and I have an annoying problem. Since I'm using Select method / SelectionColor property to highlight syntax, I must always store the current cursor position in a variable and then restore it by calling the Select method like this: this.Select(CursorPosition, 0). However, a problem occurs when contents of the textbox spread over more than one page. Namely, the call I use always causes the control to redraw in such manner that the line where CursorPosition is located becomes the first line of the visible area of the textbox, effectively shifting the visible area of the textbox a number of rows down. For example:
Pic 1
Pic 2
It is very disorienting, but I have no idea how to stop it from occuring. Is there some API call or something that can position the cursor within the control without causing this stupid change of focus? If anyone can offer me a way around the problem I will be most grateful.
|
|
|
|
|
How could I change the data source of a dataGrid in run time (Windows Forms)?
datagrid.Update()
What I am trying to do is, to change the data source of the data grid with respect to CustomerID..
If customerID is changed, than the dataView will retrieve the data from DataSet table and then update the datagrid ,without changing data source , update data source with DataView But I couldnt find the method, please guide me to achieve.
Is it possible ?
Thanks ,
Bahadir Cambel
|
|
|
|
|
Hi,
Why to change the datasource? Instead that we can associate the Dataview to the datagrid. Filter the DataSet into Dataview using RowFilter and RowStateFilter properties of Dataview.
Dataview.RowFilter = "customerID=xxxx";
Thanks
SGS
|
|
|
|
|
thanks for the reply ,
but my problem is to update the datagrid.
I can not update the dataGrid when I change the dataView.
To be more specific
I have a curreny manager which is holding the information about the customers named cm
I have 2 dataTables dt_Orders and dt_Customers for orders and customers
I inserted the update operation into ShowCurrentRecord which is called when CurrenyManager_PositionChanged event..
<code>
private void cm_PositionChanged(object sender, EventArgs e)
{
ShowCurrentRecord();
}
private void ShowCurrentRecord()
{
string CustomerID=ds_Customers.Tables["dt_Customers"].Rows[cm.Position]["CustomerID"].ToString();
for(int i =0 ;i <RowCount ;i++)
{
<p>if ( ds_Customers.Tables["dt_Orders"].Rows[i]["CustomerID"].ToString()==CustomerID )
{<p>myDataView.RowFilter="CustomerID="+CustomerID;</p>
</code>
It turned out to be , I can not set anything into RowFilter..
even if I tried dv.RowFilter="CustomerID"+CustomerID;
dv.AllowEdit();
dv.BeginInit();
When I use Watch the find the value , although CustomerID has its value , watch always shows RowFilter as null string..
Does dataView can be edited in run-time ?
|
|
|
|
|
Hahahah , the whole problem was myDataView.RowFilter = "CustomerID= '"+CustomerID+"'"; : )
|
|
|
|