|
Currently the project is taking a tremendous amount of time to load. And we are required to have a loading image showing while the application is accessing the data from the database. The code below is where the asynchronous code should be placed so I am being told by my fellow co-workers.
Public Sub Init(ByVal solution As Solution)
LoadingDataSymbol.Visible = True
_presenter = New TranslationPresenter(Me)
_presenter.getProjects(solution)
End Sub
This code sets the image visible and gets the data from using getProjects(solution). I am required to make these two items async and turn the image visible before and invisible after.
Any suggestions???
|
|
|
|
|
Look into the BackgroundWorker component in the ToolBox.
|
|
|
|
|
How would that be incorporated in the code that I had just posted?
|
|
|
|
|
You drop the component on the form, then in your Init code for the form, setup the event handlers, then send it on it's way. Read this...[^]
|
|
|
|
|
Thank you!
|
|
|
|
|
Hello,
I have an application that acts as a plugin for another. It is to enter translation data. I am currently using the software DevExpress (DXCore)to use the plugin. However, this is not going to work because the application will need to be installed on other developer's computers and I only want the one setup file for the actual plugin, as well as DevExpress is not aloud to be used at my work. Does anyone know of another free software to use that does not require a client install?
|
|
|
|
|
You could always roll your own. I don't of any free libraries that you don't have to install.
|
|
|
|
|
We will need an install but unfortunately DxCore does not allow us to Package it into our setup file for the plugin we are creating. We are looking for something that can be packaged with our setup? Any ideas?
|
|
|
|
|
Nope. The only time I did plugin support for an app, I rolled the entire solution myself - no third-party libraries...
|
|
|
|
|
Dear everyone,
I have created a .mdf database with a table with 3 colums Name, Place, Date.
There are 100 entried of all these 3 columns with different Names,Places and Dates. I want to search the entries by date, e.g. all the data having Date >= 10/08/2009 and <= 25/08/2009.
I have already created a Datagridview displaying all these 3 colums, but finally I want to search the number of records based on date ( which I mentioned above) and count the number of rows from this search.
Hope my query is clear.
Thanks.
|
|
|
|
|
No, your quesy is not clear at all. What part of this are you having problems with??
|
|
|
|
|
well there are several ways
1).
DataSet object>.Tables[0].Rows.Count
2).
Dim con As New SqlConnection(gConnectionString)
Dim cmd As New SqlCommand("select field from table where clause", con)
Dim i As Integer = 0
con.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader()
While dr.Read()
i = i + 1
End While
dr.Close() : con.Close()
3). you can also use query
"select fld,count(fld) as RecordCount from table where clause"
Hope so any one of abv will work for you
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
First, you replied to the wrong post. I got an email saying you replied, but the original post did not.
Second, you're support supporting searching between two dates at all, so how does this solve the OP's problem??
|
|
|
|
|
Excuse Me this reply is for whom
I think so the Question is
count the number of rows . from this search
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
Ok. I will will explain You.
I have a datagridview of 3 columns in a database, "Student_Name", "Age" and "Date_of_Joining".
1) I want to search the number of students based on "Date_of_Joining", e.g. "Date_of_Joining" >= 10/08/2009.
2) The search results in number of rows matching this, so that I can count the number of rows also.
3) Once I get the search results, I want to update the Name.
Hope the problem is clear now. Any help is appriciated on Point 1 & 2 above.
|
|
|
|
|
jeshra279 wrote: Hope the problem is clear now.
Nope. Are you having a problem with the SQL part?? Getting VB.NET to execute the SQL statement?? Parameters for the SQL statement?? You want to update the name of what? I don't see what ou're picking a single record out so you can update a "Name"?
|
|
|
|
|
This will get the number of records between the 2 dates. Note the date format when passing a string.
Select count(*) from Table where Date between '2009-08-10' and '2009-08-25'
Also look into parameterised queries.
Use
Select * from Table where Date between '2009-08-10' and '2009-08-25'
to get the actual records and then table.rows.count()
|
|
|
|
|
Thanks. I am able to start working on the queries which You sent. But I am getting a small problem in this.
In my database, the date entered is in format, e.g. "08/10/2009 3:14:00 PM".
Now when i am choosing this date from my datetimepicker control, it selects the correct date, but not the time; i mean it selects the current time, say e.g. "08/10/2009 7:55:00 AM".
But I want to filter my database column using the selected date and time from the dateTimePicker control.
My code for filter is :
cmd = New SqlCommand(" SELECT * FROM client_details WHERE DateofJoining BETWEEN #" + Convert.ToDateTime(timefrm.ToString()) + "# AND #" + Convert.ToDateTime(timeto.ToString()) + "# ")
what are the steps involved after this to retrieve the data from the datagridview?
Consider in my example, "timefrm" is 08/10/2009 9:00:00 PM and "timeto" is "08/12/2009 9:00:00 PM" .
I mean, I want to filter my record between these dates and then count the number of filtered rows.
Can anyone help me on this?
|
|
|
|
|
Ok, you MAY have made mistake number one in database design. Store your dates as datetime, not as varchar. You should immediately go and change you format to datetime, wear any pain there is for validating existing data but do it now. Life will ony get worse from here on if you don't.
When storing a datetime from client pass in Today instead of Now - eliminates the time component of the datetime (unless it is required of course)
You should try eliminating the time from the datetimepicker (short format) and add 9pm to the result.
Also look into parameterised queries, they may be complex to start with but will make you life a lot simpler and safer (sql injection[^]).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
Ho can I send commands to remote server's command prompt..
Please Help...
Be an Eagle, Sky is Yours.
|
|
|
|
|
You don't. The CMD prompt has no facility like a "remote shell". What are you trying to do with the remote CMD prompt??
|
|
|
|
|
Telnet?
If everything was not true, would it be not true that everything is not true? So by saying everything is not true, you are automatically denying that everything is not true. Im so confused...
FreeDOS
- An open source modern
MS-DOS/PC-DOS replacement.
|
|
|
|
|
Hi,
I need to get the information if the current user is in role Administrators!
I start the program non elevatet (because else the uac prompt always show) then I check if an update is available,
if an update is available then I restart the application elevated because i need to install a update!
My issue is how to check if the current user is in role Administrators when the program is started non-elevated??
This is my code to check if user is admin, this only works if program is started elevated! (Windows Vista)
Public Function IsUserAdmin() As Boolean<br />
Dim UserPrincipal As WindowsPrincipal<br />
<br />
UserPrincipal = New WindowsPrincipal(WindowsIdentity.GetCurrent())<br />
If UserPrincipal.IsInRole(WindowsBuiltInRole.Administrator) Then<br />
Return True<br />
Else<br />
Return False<br />
End If<br />
End Function
Does anyone knows how to solve this??
|
|
|
|
|
Hi,
this C# code gets me all roles in a string:
try {
Thread.GetDomain().SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal wp=new WindowsPrincipal(WindowsIdentity.GetCurrent());
foreach(object roleName in Enum.GetValues(typeof(WindowsBuiltInRole)))
if (wp.IsInRole((WindowsBuiltInRole)roleName)) roles.Add(roleName.ToString());
} catch (Exception exc) {...}
string s="User name = "+Environment.UserName+" Windows role = "+string.Join(", ", roles.ToArray());
I trust you can easily convert that to VB.NET
|
|
|
|
|
Hi,
this is virtual the same code like mine, the issue is that on vista when the program started non-elevated ("asInvoker") the current user has permissions of a standard User (I only get the User role), but I need to check if the logged on user is in group administrator (for me it is regardless if the current user started this program as standard user), because then i start a new process with the current user as admin!!
I need to first start the application as standard User because else i always get the windows vista prompt screen!
|
|
|
|