|
It may be worth looking into AutoIT[^].
I have not used it in anger, so to speak, but have heard it recommended on a few occasions and the scripting language does seem to have the features you are looking for.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
HI, Guys
I am new at doing reports in VB.NET 2010. I saw so many tutorial on youtube which explains how to create reports in VS2010 using reportviewer, datasource etc. I saw that connection made by Datasource and then Fields are placed on report, then Create new form, place report viewers then select report from report source etc etc etc .
Basically tutorial explains how to create by report in VS by data source tools but what if I have to move or change path of Database (I use MS access for database).
I am able to do everything to generate report but i want dynamic connection string for report viewer, I am NOT using crystal report
How do I have database path @ run time, is there any link or video tutorial would be very help full.
|
|
|
|
|
Hi All,
I am new to here. I have a situation where I need to create zip files from 5k files but with condition, the size of the zip file should not be more than 2MB so. Here, what I am doing is, creating Numerous zip files from all the 5kfiles.
Is there any script, code already available for this task? Is it possible to achieve this?
Thank you In Advance,
Best Regards,
Arjun
|
|
|
|
|
It depends on the capabilities of the .ZIP library you're using. Consult the documentation on whatever you're using to find out if it can do that.
You may just have to add a file to the .ZIP, save it, check the file size, then add another until you cross the limit you're looking for. Once there, remove the last file and you're back down to whatever limit you imposed.
|
|
|
|
|
Have a look at DotNetZip[^] - the examples page[^] shows how to do this, under the title "Create a split zip containing all the files in a folder":
Using zip As New ZipFile()
zip.AddDirectory("c:\my Documents\ProjectX", "ProjectX")
zip.Comment = "This zip was created at " & System.DateTime.Now.ToString("G")
zip.MaxOutputSegmentSize = 2*1024*1024
zip.Save("ProjextX.zip")
End Using
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
hi evreyone,
i have a form "backgroundfrm" that contain only a panel and another form "Mainfrm"
that have more than one button. The buttons backcolor properties set to
tansparent. I load the "backgroundfrm" inside the "Mainfrm" so the "backgroundfrm"
act as a background of the "Mainfrm". My codes are working but the problem is..
The buttons is not blending to the background ("Backgroundfrm" act as background
of "Mainfrm"). Its not transparent anymore.
I hope you understand me guys.
Help me please...
Thank you in adnvance..
Here's my codes
Dim bckgrndfrm As New backgroundfrm
bckgrndfrm.TopLevel = False
bckgrndfrm.WindowState = FormWindowState.Maximized
bckgrndfrm.Visible = True
Me.Controls.Add(bckgrndfrm)
|
|
|
|
|
You're going to have an extremely hard time with this. Windows Forms does not do transparent controls very well, and it does even worse with transparent forms.
Setting the background of a control to Transparent only tells the control to take on the background properties of the control that contains it. It does NOT make the control transparent!
WPF is far better at doing this as it actually makes things transparent.
|
|
|
|
|
I'm lost here, and I'll try to keep this brief.
I'm trying to create my first ReportViewer project here.
Here's what I've done so far.
1. Create a windows form with a single ReportViewer Object
2. Create a RCDL file, with a header and footer and a tablix in the body, 1 column 1 row.
3. Created a class file, that gets the data. I call the class in the form with the report viewer.
I'm pretty sure the code below works right. but I don't understand the relationship to the code and the tablix, how to populate the tablix with data.
I read these examples, and they all show how to assign a dataset to the rldc, and that's where I get lost.
I'm not doing a data dump here, I'm just showing what I have so far.
Wondering if I'm on the right track here.
Question 2:
Is there a way I can make some hard code some data to practice populating the tablix so I can learn how it works?
Private Sub practice()
rv_Canvas.ZoomPercent = 100
rv_Canvas.BorderStyle = Windows.Forms.BorderStyle.FixedSingle
rv_Canvas.Visible = True
rv_Canvas.ShowProgress = True
rv_Canvas.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
rv_Canvas.LocalReport.ReportEmbeddedResource = "AccountMate.profit_items.rdlc"
'Build the DataTable for item_profit
Dim rs_Table As DataTable = New DataTable()
rs_Table.TableName = "dt_item_profit"
'FITEMNO
Dim FITEMNO As DataColumn = New DataColumn
FITEMNO.DataType = System.Type.GetType("System.String")
FITEMNO.ColumnName = "FITEMNO"
rs_Table.Columns.Add(FITEMNO)
Dim ds As DataSet = New DataSet()
ds.DataSetName = "DataSet1"
ds.Tables.Clear()
ds.Tables.Add(rs_Table)
ds.Tables(0).TableName = "tablix1"
'this is where I get confused.
'what is ds.tables(0)?
'tablix1 is just 1 row 1 column, and is assigned to dataset1
rv_Canvas.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", ds.Tables))
'Refresh the Report
rv_Canvas.RefreshReport()
End Sub
modified 29-Jun-14 16:39pm.
|
|
|
|
|
So made a smaller version of the code on the windows form, And used some Gridview knowledge and created a datarow with static data.
I went back and created a new XSD file for the dataset and attached it to the tablix. Actually I created a dataset file and added a datatable to it with 2 columns that match the names of the DataColumns in the code below.
Then went back to the RDLC file and programed the tablix with the dataset name and columns.
This part works!, I can add 1 row of data with 2 columns, huge for me, it's a start now. I think I see how it works now and what the relationship in all the pieces now, plus I didn't have to use the wizard and bind lots of stuff.
Since I'm using an old Account Mate DOS database files, I think I will pursue this manual operation here. I really don't want to use the oledbadapter and fill on this project here.
Private Sub practice()
'Build the DataTable for item_profit
Dim rs_Table As DataTable = New DataTable()
rs_Table.TableName = "dt_item_profit"
'FITEMNO
Dim FITEMNO As DataColumn = New DataColumn
FITEMNO.DataType = System.Type.GetType("System.String")
FITEMNO.ColumnName = "FITEMNO"
rs_Table.Columns.Add(FITEMNO)
Dim FDESCRIPT As DataColumn = New DataColumn
FDESCRIPT.DataType = System.Type.GetType("System.String")
FDESCRIPT.ColumnName = "FDESCRIPT"
rs_Table.Columns.Add(FDESCRIPT)
Dim rs_DataRow As DataRow
rs_DataRow = rs_Table.NewRow()
rs_DataRow(0) = "17-209SOFT"
rs_DataRow(1) = "Troxell Supersoft Kneepad Original Small"
rs_Table.Rows.Add(rs_DataRow)
Dim ds As DataSet = New DataSet()
ds.DataSetName = "ds_item_profit"
ds.Tables.Clear()
ds.Tables.Add(rs_Table)
ds.Tables(0).TableName = "tablix_item_profit"
rv_Canvas.ZoomPercent = 100
rv_Canvas.BorderStyle = Windows.Forms.BorderStyle.FixedSingle
rv_Canvas.Visible = True
rv_Canvas.ShowProgress = True
rv_Canvas.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local
rv_Canvas.LocalReport.ReportEmbeddedResource = "AccountMate.profit_items.rdlc"
rv_Canvas.LocalReport.DataSources.Add(New ReportDataSource("ds_item_profit", ds.Tables(0)))
'Refresh the Report
rv_Canvas.RefreshReport()
End Sub
|
|
|
|
|
Hi There, i created a calendar with 37 datagridviews on a form, i've put all my datagridviews in to an array collection
Public AllDatagrids As DataGridView() = {DGDays1, DGDays2, DGDays3, DGDays4, DGDays5, DGDays6, DGDays7, DGDays8, _
DGDays9, DGDays10, DGDays11, DGDays12, DGDays13, DGDays14, DGDays15, DGDays16, _
DGDays17, DGDays18, DGDays19, DGDays20, DGDays21, DGDays22, DGDays23, DGDays24, _
DGDays25, DGDays26, DGDays27, DGDays28, DGDays29, DGDays30, DGDays31, DGDays32, _
DGDays33, DGDays34, DGDays35, DGDays36, DGDays37}
which makes it easier to control which datagridviews are visible or not depending on the user selection on the month they select from a combo box.
Now when a user clicks on a row in any datagridview it opens up another form and displays additional information in a breakdown sort of way.
All my code is working fine except that it is way too long and i would like to shorten it, because i have now got duplicated code in my project.
Each datagridview has a double click event so i have 37 of these
Private Sub DGDays1_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DGDays1.CellContentDoubleClick
With DGDays1
If .SelectedRows.Count <> 0 Then
Dim row As DataGridViewRow = .SelectedRows(0)
GetdataAndFillDetailsForm(row.Cells(3).Value, row.Cells(5).Value)
End If
End With
End Sub
i have created an event handler to manage the double click event of all the datagridviews which resides in my main form load event
For Each DataGridView In Modall.AllDatagrids
AddHandler DataGridView.CellContentDoubleClick, AddressOf DGArrayClick
Next
Which in turn after the user double clicks a cell on any of the datagridview it runs this code
Private Sub DGArrayClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs)
End Sub
so i've been trying to figure out how to get a value of the row selection from the double click event of the datagrid and i have a code block
i want to try and run something like this inside my DGArrayClick sub
GetdataAndFillDetailsForm(row.Cells(3).Value, row.Cells(5).Value)
is it possible and if so, could anyone give me a direction on how to go about it please?
|
|
|
|
|
I Have inside a list view a dropdown list as follows:
<td>
<asp:DropDownList ID="ddlAllocatedTeam" runat="server" CssClass="inputsize-1-3" DataSourceID="odsAllocatedTeam" DataTextField="TeamName" DataValueField="TeamID" AppendDataBoundItems="true" AutoPostBack="true" SelectedValue='<%# Eval("TeamID") %>'>
<asp:ListItem Text="Please Select .." Value="-1"></asp:ListItem>
</asp:DropDownList>
<asp:ObjectDataSource ID="odsAllocatedTeam" runat="server" TypeName="Team" SelectMethod="List">
<SelectParameters>
<asp:Parameter Name="SearchTerm" Type="String" ConvertEmptyStringToNull="false" DefaultValue="" />
<asp:ControlParameter ControlID="ddlSeason" Name="SeasonID" PropertyName="SelectedValue" />
<asp:Parameter Name="Showall" Type="INT32" DefaultValue="0"/>
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField ID="hdfTeamID" runat="server" Value='<%# Eval("TeamID") %>' />
</td>
I bind the list as follows:
Protected Sub lvData_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewItemEventArgs) Handles lvData.ItemDataBound
If e.Item.ItemType = ListItemType.Item Then
Dim ddlAllocatedTeam As DropDownList = e.Item.FindControl("ddlAllocatedTeam")
Dim hdfTeamID As HiddenField = e.Item.FindControl("hdfTeamID")
ddlAllocatedTeam.SelectedValue = hdfTeamID.Value
ddlAllocatedTeam.DataBind()
End If
End Sub
When I edit and update the row I get the following error message
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
I need to be able to update the record not changing the value or on index change on ro drop down list need this updating
|
|
|
|
|
Hi,
i have a legacy code in VB.Net 1.1 and Sybase ASE 12.5, system is working fine as i took over from previous developer. Now client want to upgrade to ASE 15.7. we created a totally new environment and installed DB and ASE Client on new machines.
I was getting Connection Error while connecting with new DB.
I modified connection string in web.config
Previous:
<add key="connectionString"
value="Provider=Sybase.ASEOLEDBProvider.2;Server Name=DBDV01;Initial Catalog=RLDB;Password=db_user;User ID=db_user;Server Port Address=4100;Persist Security Info=True">
New:
<add key="connectionString"
value="Provider=ASEOLEDB;Server Name=DBDV01;Initial Catalog=RLDB;Password=db_user;User ID=db_user;Server Port Address=4100;Persist Security Info=True">
Login works fine however just after Login when system tries to run any other query in database I get following error message:
[Message Class: 14][Message State: 1][Transaction State: 1][Server Name: DBDV01]
[Native Code: 924] [ASEOLEDB]Database 'RLDB' is already open and can only have one user at a time.
[Message Class: 11][Message State: 1][Transaction State: 1][Server Name: DBDV01]
[Native Code: 4001][ASEOLEDB]Cannot open default database 'RLDB'.
[Message Class: 10][Message State: 1][Transaction State: 1][Server Name: DBDV01]
[Native Code: 5704][ASEOLEDB]Changed client character set setting to 'iso_1'.
[Message Class: 10][Message State: 2][Transaction State: 1][Server Name: DBDV01]
[Native Code: 5701][ASEOLEDB]Changed database context to 'master'.
[Message Class: 10][Message State: 1][Transaction State: 1][Server Name: DBDV01]
[Native Code: 5703][ASEOLEDB]Changed language setting to 'us_english'.
I am also getting similar error if i try to open both SYBASE CENTRAL and SQL ADVANTAGE at the same time.
any help will be welcome.
|
|
|
|
|
I don't know sh*t about Sybase, but it seems like this would be your problem:
[Native Code: 924] [ASEOLEDB]Database 'RLDB' is already open and can only have one user at a time.
|
|
|
|
|
Hi everybody,
I want to find in html string specific attributes and remove everything in between.
EX:
<>
<>
<>
<>
<>
<>
<>
<>
I want to remove all and in between
Thank you
|
|
|
|
|
|
I'm using VB.net 2013 , Entity framework and SQL Server 2008R2.
I have a strange situation: I have a form/wizard that restores a database from a copy. I restore the database using SMO.The restore is completed without problems, but immediately after restore I try to connect to database using this code :
Dim context as MyEntity
context=New Myentity
query = From t in context.Mytable select t
I get an error :
An exception has been raised that is likely due to a transient failure. If you are connecting to a SQL Azure database consider using SqlAzureExecutionStrategy.
If a try after some time the same code , everything is ok.
What can I do ?
Thank you !
|
|
|
|
|
dilkonika wrote: What can I do ? Retry[^] the operation. The fact that the database has been restored completely doesn't mean it is immediatly available for querying. Give the server a second to attach and load, and try to connect again.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Sorry ! But the sql server is on local PC , and on the computer where I have created the application (inside Visual studio , or with the final exe ) everything is ok. Only on the computer where I try to install and run my application I have this error.
|
|
|
|
|
dilkonika wrote:
Sorry ! But the sql server is on local PC , and
on the computer where I have created the application (inside Visual studio , or
with the final exe ) everything is ok. Only on the computer where I try to
install and run my application I have this error.
No sorry's required; I don't consider it an error, as it is likely that the server is still loading the database. Is the database-server that gives the error also hosting other databases? Than that might explain why it takes longer there than on your machine.
The most likely difference is the production machine's database is probably set to "simply recovery mode".
You might also want to be checking the event-log; see if SQL Server has dropped any hints there. You might also want to try the backup/restore procedure with another database, like the AdventureWorks database from Microsoft. If that also takes long, then it is due to something in that machine; be it different hardware, different software or different settings.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Dim i As Integer
Dim s As String = "Aaa"
Dim pAR() As String = Split("aaa,AAA,bbb,BbB,ccc,CcC", ",")
i = Array.FindIndex(pAR, Function(x) x.IndexOf(s, StringComparison.InvariantCultureIgnoreCase))
Returns 2 but I would expect it to be 0.
|
|
|
|
|
It says 2 because you're asking the FindIndex function to return the first element where the x.IndexOf call returns a non-zero value, and that's at index = 2.
In most languages, a non-zero value is always considered True and a zero value is False.
Read up on the IndexOf() and String.Compare() documentation and you'll understand why it's not behaving like you think it should.
To get it to work like you want, you'd change that line of code to:
i = Array.FindIndex(pAR, Function(x) x.IndexOf(s, StringComparison.InvariantCultureIgnoreCase) = 0)
|
|
|
|
|
Thanks
I am very familiar with IndexOf. I was looking for a case insensitive version of IndexOf when I came across this code.
The MSDN doc for FindIndex has
returns the zero-based index of the first occurrence within the List(Of T) or a portion of it.
So I was expecting it to return 0 since the first occurrence of a case insensitive "Aaa" in
"aaa,AAA,bbb,BbB,ccc,CcC"
would be 0 not 2. (2 would be bbb)
I do want to index in the entry in the array not a True or False.
Now you code DOES WORK so thanks but I do not see how it matches the MSDN doc and why your code works.
|
|
|
|
|
Remember, I keep emphasizing that a non-zero value evaluates to True and a zero value is False.
You're not actually understanding how the FindIndex and IndexOf methods work. FindIndex will return the first item passed to the comparator function you provide that returns True (a non-zero value).
Keeping that in mind, IndexOf returns an integer value of the index in the string where the string you're searching for is found. Zero if the term to search for is Empty(False), a value of 0 or greater if it is found (True) and -1 if it is NOT found (True!).
So, rewrite your code to break things out a bit more and step through the code in the debugger. Launch it by hitting F11, not F5, and step through the code one line at a time by hitting F11 and then hover the mouse over the variables you want to inspect the values of.
Sub Main()
Dim i As Integer
Dim s As String = "Aaa"
Dim ar() As String = Split("aaa,AAA,bbb,BbB,ccc,CcC", ",")
i = Array.FindIndex(ar, Function(x) Contains(x, s))
Console.WriteLine("I is " & i)
End Sub
Private Function Contains(a As String, b As String) As Integer
Dim returnValue As Integer = a.IndexOf(b, StringComparison.CurrentCultureIgnoreCase)
Console.WriteLine("Searching for '{0}' in '{1}' returning: {2}", b, a, returnValue)
Return returnValue
End Function
To fix this version, it's that same as before:
Sub Main()
Dim i As Integer
Dim s As String = "Aaa"
Dim ar() As String = Split("aaa,AAA,bbb,BbB,ccc,CcC", ",")
i = Array.FindIndex(ar, Function(x) Contains(x, s) = 0)
Console.WriteLine("I is " & i)
End Sub
Private Function Contains(a As String, b As String) As Integer
Dim returnValue As Integer = a.IndexOf(b, StringComparison.CurrentCultureIgnoreCase)
Console.WriteLine("Searching for '{0}' in '{1}' returning: {2}", b, a, returnValue)
Return returnValue
End Function
modified 23-Jun-14 17:16pm.
|
|
|
|
|
Dave Kreskowiak wrote: Zero if it's not found (False), a value greater than 0 if it is found (True) and -1 if it is NOT found (True!).
In other words, "if it's not found it returns 0, but if it's not found it returns -1".
Well, that's not going to confuse matters at all!
If the sub-string is not found, it returns -1; if it is found, it returns the zero-based index at which it was found. It the sub-string is found at the start of the string, it returns zero.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Crap.
Mistyped that one! It should be if the string to search for is Empty, 0 is returned.
|
|
|
|
|