|
ok,i'll get a try,i'am sorry my english is poor
|
|
|
|
|
Hello,
Does anyone know how to enable paging on a datagrid using adodc connection? So far I have almost 1000 records that needs to be displayed. This query dsplays via scroll bar. I'd like divide these records by page. Thanks in advance!
Sorry I forgot to mention I'm doing a windows application not web. I've weird thing is AllowPaging is not available in datagrid option or in any other options. Any help would be much appreciated. Thanks again!
Aim small, miss small
|
|
|
|
|
As far as I can remember, there is no paging "option" on the old grids. You had to implement it yourself providing code and SQL to grab the next/previous page from the database and bind to that.
|
|
|
|
|
Ahh...that explains why I can't find that darn paging option. So it has to be done the long way...Many thanks friend!
Aim small, miss small
|
|
|
|
|
Hi,
I'm doing a vb.net (Window Application) project.
I'm retrieving data to a datagrid. It has checkbox at the 1st column (DataGridBoolColumn).
User is able to check or uncheck the rows in datagrid.
Once user click save, how can i insert those rows where checkbox is selected into SQL table?
I found few samples but those are for asp.net.
Can anyone advice me as i'm using window application.
Thanks in advanced.
cheers,eunice
|
|
|
|
|
Hello Euince,
You would have to manually insert the rows into SQL table by looping through the rows and check if
the first column is checked or not.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Hi Allen,
Thanks for the tips. But how can i loop through?
Is it something like this?
For i = 0 To icounter - 1
If myTable.Rows(0).Item("check") = True Then
Dim RawID As Object = dgResult.Item(i, 2)
Dim Question As Object = dgResult.Item(i, 3)
strQuery = "Insert into udtInsert (RawID,Question) values(" & RawID.ToString() & ",'" & Question.ToString() & "' )"
conn.Open()
cmd.CommandText = strQuery
cmd.Connection = conn
End If
Next
pls advice... thanks a lot.
cheers,eunice
|
|
|
|
|
Hi,
i have designed a new control with some propertys. Some of the propertys should only at runtime be available, not at designtime.
Codesample:
<system.componentmodel.designtimevisibleattribute(false)> _
Public Property MyProperty As Boolean
Get
......
This doesn't work.
But
<system.componentmodel.designonly(true)> _
Public Property MyProperty As Boolean
Get
......
works fine, property is only avialable at designtime, not at runtime.
Something like RuntimeOnly is missing ?!
Any comments ?
bauer
|
|
|
|
|
You didn't check the "Ignore HTML tags in this message" box at the bottom of your post before you hit "Post Message", so some of your code is missing from your post.
But, hiding a public property from the PropertyGrid (Designer) is easy. All you have to do is specify the Browsable attribute on your property.
<Browsable(False)> _
Public Property MyProperty() As Integer
...
End Property
|
|
|
|
|
Dave,
your
<Browsable(False)> _
Public Property MyProperty() As Integer
... End Property
prevents the property to be accessed with the property window. But the designer still generates code to set the property.
Okay, i can code <DesignerSerializationVisibility ....>, so no code setting the property is generated.
But placing the control on any form executes the Get Method of the Property.
How to create a Property which is only avialable at runtime and excutes only at runtime ???
Something like the opposite of <System.ComponentModel.DesignOnly(True)> seems to be missing.
regards
bauer
|
|
|
|
|
In the property code, check the DesignMode property to see if it's being used in the designer. There are pitfalls to doing this, though. The DesignMode property isn't known for its reliability.
Public Property SomeProperty As Integer
Get
If Me.DesignMode Then
' The control is being used on a design surface...
Else
' The control is NOT being used a design surface...
End If
End Get
...
End Property
|
|
|
|
|
Dave,
thank you very much, for your quick reply.
I think, this coding (Process.GetCurrentProcess.ProcessName = "devenv") isnn't much better ?!
regards,
bauer
|
|
|
|
|
iam using select case statement .in this iwant to work with two select statements by which one select statement works on the user eneterd value and other select statement should work for every select case ..is it possible
|
|
|
|
|
Like another control statement the case statement could also be nested but nested will give the complex code to you so i suggest you to call function so on select statement you could call the function according to the values entered by user.
With Regards
Yogesh Agarwal
|
|
|
|
|
Hi All
i have a grid control (Sheridan Grid) in my visual basic 6 application this grid has his first row as a checkbox column,
Now the problem is
I want to call a function when user check or uncheck the column but i unable to do the same i tried the aftercolupdate event but it will show the runtime error and my application will close after that error. The calculation goes fine but the problem is that run time error.
The error is :-
"Visual Basic has encountered a problem and needs to close. We are sorry for the inconvenience"
Then it display the message for sending the problem to microsoft with send and din't send button
plz help in resolving the problem ...
With Regards
Yogesh Agarwal
|
|
|
|
|
My Problem was solved, plz do not reply
with Regards
Yogesh Agarwal
|
|
|
|
|
Great job on completing it yourself. However, you should post the code that let to your solution, so if any other member here has the same problem, they may stumble upon your post and be able to fix theirs quickly!
I'm going to become rich when I create a device that allows me to punch people in the face over the internet.
"If an Indian asked a programming question in the forest, would it still be urgent?" - John Simmons / outlaw programmer
|
|
|
|
|
I use the Change Event for Grid Control and check the column Index if it the desire column then i call the function to do the task i suppose to do.
<br />
<br />
Private Sub gridOptional_Change()<br />
If gridOptional.Col = 0 Then<br />
calculateamt<br />
<br />
ElseIf gridOptional.Col = 5 Then<br />
gridOptional.Columns(6).Value = gridOptional.Columns(4).Value * gridOptional.Columns(5).Value<br />
calculateamt<br />
End If<br />
<br />
End Sub<br />
<br />
<br />
With Regards
Yogesh Agarwal
|
|
|
|
|
I hv downloaded following codes to save image from vb.net 2005 to Mysql.
Private Sub cmdSaveDB_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSaveDB.Click
If picShowPicture.Image Is Nothing Then Exit Sub
Dim ms As MemoryStream = New MemoryStream
picShowPicture.Image.Save(ms, ImageFormat.Jpeg)
Dim bytBLOBData(ms.Length - 1) As Byte
ms.Position = 0
ms.Read(bytBLOBData, 0, ms.Length)
Dim prm As New MySql.Data.MySqlClient.MySqlParameter("@BLOBData", _
MySql.Data.MySqlClient.MySqlDbType.Blob, _
bytBLOBData.Length, ParameterDirection.Input, False, _
0, 0, Nothing, DataRowVersion.Current, bytBLOBData)
Dim ConnectionString As String = "SERVER=localhost;" & _
"PORT=3306;DATABASE=pictureDB;User Id=root;" & _
"PASSWORD=pass;"
Dim QueryString As String = "INSERT INTO blobtest ( BLOBData ) VALUES ( @BLOBData )"
MsgBox(QueryString)
Dim myConnection As New MySqlConnection(ConnectionString)
Dim myCommand As New MySqlCommand(QueryString)
myCommand.Connection = myConnection
myCommand.Parameters.Add(prm)
'Open the connection
myConnection.Open()
'Execute the query
myCommand.ExecuteNonQuery()
'Close the connection
myConnection.Close()
End Sub
But it is giving me a error saying imageformat is not declared.. How to solve it.. Plse help me..
|
|
|
|
|
Please read on how to ask good questions, 'please help me' is not a reasonable header. Everyone here wants help.
Which line gives the error ? As the word 'ImageFormat' does not appear in the code you pasted, I assume it's not one of these lines ? Have you tried using the debugger ?
This is what happens if you copy code off the web at random, articles and code snippets are great, but you need to take the time to understand them before you use them.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You have to import the namespaces that the code uses.
If you look up ImageFormat in the documentation, you see that it's in the System.Drawing.Imaging namespace.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
How do I get the id (primary key) of a row that I just insertyed into the database, so that I can insert the id into the foreign key of another table?
|
|
|
|
|
How are you inserting your data? What database are you using?
If you are using SQL Server stored procedures, it is very easy to get using a return parameter set to @@identity.
|
|
|
|
|
I am using the Tables object in SQL Server 2005 Express. I am not using the stored procedures object.
I am using the insert statements that are generated using the data source configuration wizard in Visual Basic 2005.
Is there a way to do it in VB.NET.
|
|
|
|