How To Preserve A Linq Querry
May 12, 2010If I write
[code]...
If I write
[code]...
I need to extract some data from a list with a linq querry like
(from p as MYClass1 In List where P.Datetime> UserDate1 P.Datetime< UserDate2 Select p Skip (StartPoint) Take (Range)
I've not found any info on this again, i think i asked a while back ago and can't find it. But what I have is an application that stores data in xml files. I read these files in/out through datasets. My question is, can i filter or requerry these datatables in the datasets? and how?
View 7 Repliesim having some problems, when i do my query from my vb.net program to my mysql DB the data is sent, but its missing some things, let me explain.my query is pretty simple im sending a file path to my DB so that after i can have a php website get the data and make a link with the data from my DB, but when i send my data the results look like this.[code]but next time its going to be something else so i cant hard code the paths, i was looking more of a sql query switch that i might not know, since i already thaught about searching my string and if it finds a backslash it adds another one, but i feel its not a good way to script the whole thing..
View 3 RepliesI've search this forum and haven't found the answer to this problem and bing new to VB 2010 [cod]e...
View 8 RepliesI have a code to pass the querry from a one page that has a gridview hyperlink but what i didn't know is how to retrieve it.. Here is my code
[Code]...
I have one text box where i display my current time now i want that current time record to be display in my second text box
View 4 Repliescan somebody tell me what is wrong with my insert statement? Error: Syntex error: (missing operator) in querry expressions
Dim insertQry(1), insertString As String
insertQry(0) = "insert into activities(activities, place, days, act) values"
insertQry(1) = "('" & txtStudents.Text.ToString & "','" & lstEvent.Text.ToString & "', '" & txtNote.Text.ToString & "' '" & txtName.Text.ToString & "')"
[Code]...
I have simple ASP.net web form. With a simple click on a button i need to call a the Multithread process in order to execute my querry in SQL Server DB. I know that my querry willl take up to 45 min to be executed. While the process is running i need to display some status information like: Starting time, Time elapsed, % of completed...So after running the process i got the following error message: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."So i have 2 problems to fix:
Avoid getting timeout while processing/calling the stored procedure. I tried to add cmd.CommandTimeout = 1000 but it didn't work out!
Display correctly Time elapsed and % Completed while processing.
Here's my code in the main form:
Imports System
Imports System.Data
Imports System.Configuration
[code]....
This should be fairly basic, but say I have a Public property as local variable on my WCF service, and I set this in one call to the service. Is there a way to preserve that data for another call to the service? (Without writing the data to xml or a db, and re-referencing it or anything like that)
Executing the calls from the Winform:
Public Class ClientSideWinForm
Private proxy As ServiceReference.Client
Private Sub Client_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
[Code]....
Basically I drew something on a form using Graphics. Now if I move a window over the form the stuff I drew gets erased.Is there a way to preserve the drawing?
View 3 RepliesI am working on a richtextbox application.When I typed text into it and hit return, the returns were preserved.However, when I opened the page up in my Microsoft Vista notepad.exe program,the returns were not preserved.The text appears as if wordwrap was unselected in my notepad.exe program.I just got one long strings and no returns.How can I fix this problem so that the returns are preserved? when I open the file back up in my richtextbox program, it appears as I had typed it with all the spacing and returns.
View 6 RepliesI�m migrating a project from VB6 to VB.NET 2010 Express. Im replacing msflex grid with datagridview. But i�m not quite familiar with it. Im not using datasource. This will be done (far) latter.
So far i�m filling datagridview by code reading a recordset from mdb. Works fine.
The problem is that, I have defined the columns at visual studio designer mode, without using any code. When I open my mdi child form for the first time it works. But If I close this form and open it again a error occurs because it loses the defined columns.
how to preserve columns defined at design after close de form?
Im using system.reflection to inject a managed (.net) file directly into memory.This injection works with other managed files, but this file has data in the EOF and it wont run without that data.
View 1 RepliesConverting an object .tostring() removes the leading zeros. The object is not a fixed length, so I can't do object.tostring("0000000") where the number of zeros represents the fixed length.
An example object value is "0357" when I convert that object .tostring it becomes "357".
Is there a method for keeping the leading zeros where the length is not known?
I need to preserve a collection even after application exits. In ASP if i use application object this can be acheived. But in windows application what could i do to preserve collections?
View 4 RepliesMy form contains several NumericUpDown controls. These controls show different amount of decimal places. Later in my code I put the different NumericUpDown.Value's in a string array arrStr() like so:
arrStr(1) = NumericUpDown1.Value
arrStr(2) = NumericUpDown2.Value
arrStr(3) = NumericUpDown3.Value
Then I print the array with the File.WriteAllLines function to a text file.
If for example NumericUpDown1.Value = 1.00, NumericUpDown2.Value = 2.30 and NumericUpDown3.Value = 2.124 the file has the following values in it:
1
2.3
2.124
[Code].....
I have tried Format which works, but that formatting method is not convenient as the amount of decimal places is already set for each NumericUpDown. It would be annoying to do the work again, but now with Format.
I am trying to figure out how to preserve the values of the controls on this page (just the user-submitted commission value and the sales region (eastern is 10% and western is 20%)).[code]...
View 2 RepliesI have a situation where I need to sort arrays and preserve the current key - value pairs.
For example, this array:
(0) = 4
(1) = 3
(2) = 1
(3) = 2
Needs to sort like this
(2) = 1
(3) = 2
(1) = 3
(0) = 4
Retaining the original keys. Array.Sort(myArray) sorts into the right sequence but doesn't keep the indexes. I need a variant that does.edit Using the links, this seems close to what I want. Do I just need to remove the extra brackets to convert this to vb.net?
[Code]...
[edit]Sorry I left a bad title in this thread - confusing![/edit] Been a long time since I used an array - they are so limiting...But I need to build a simple string array - that I'm passing to a C/C++ function.
Is there any other way to do this other than keep REDIM PRESERVING??
[Code]...
[Code]...
The first time the page loads my structrure is filled correctly. After an AJAX postback all the structure fields are setting to nothing. (It seems that the Dim OldPInfo As New PInfo is called again), but i should better ask the SO Experts.
I have a function that converts a .csv file to a datatable. One of the columns I am converting is is a field of names that have a comma in them i.e. "Doe, John" when converting the function treats this as 2 seperate fields because of the comma. I need the datatable to hold this as one field Doe, John in the datatable.
Function CSV2DataTable(ByVal filename As String, ByVal sepChar As String) As DataTable
Dim reader As System.IO.StreamReader
Dim table As New DataTable
Dim colAdded As Boolean = False
[Code]...
I've created a rich text box which stored the "textBox.Text" value in an SDF database. The storing works, but the formatting seems to be lost. Is this something that SDF databases can't handle? Do I need to store in binary or something? Not sure how to do that either.I'm using Visual Basic Express Edition with Winforms and writing in VisualBasic.NET btw This is how I store to the database:
Private Sub btnToolStripSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnToolStripSave.Click
Try
Me.Validate()
Me.SangerBindingSource.EndEdit()
[code]....
And this is how I insert the text in to the rich textbox
txtBoxText.SelectionFont = New Font("Verdana", 16, FontStyle.Bold)
txtBoxText.SelectionColor = System.Drawing.Color.RoyalBlue
[code]....
I have two forms that are called by the main form. One is named frmEdit, and is invoked by the ShowDialog (modal) method. The other is named frmSearch and is invoked by the Show (non modal) method. In both cases I want to preserve the last window position so each form (class) begins with Public Class frmEdit (or frmSearch):
Dim lastx as Integer = -1
Dim lasty as Integer = -1
in the Shown event handler for each form I have the code
If lastx >= 0 Then
Me.Left = lastx
Me.Top = lasty
End If
and in the FormClosing handler I do
lastx = Me.Left
lasty = Me.Top
What I don't understand is why the frmEdit (modal) form remembers its previous position but the frmSearch (non-modal) does not. frmSearch always invokes with lastx and lasty equal to -1.
I'm not sure whether this is that right place to post this, please could you advise me of where to post it if not.I have the following code in Excel 2007 VBA querying a SQL 2005 database (saves to an Excel 2003 file in the end, hence the APP):[code]This imports the required data fine, but doesn't keep the datetime formatting that is in the SQL database. If I do the same connection manually using any of the 'Data - From Other Sources' connections it keeps the datetime.I know I can format the sheet after importing the data, however there are about 50 columns on 7 sheets, all of the dates are in different places in the sheets and there are descriptive flags which I don't want to be converted to dates, so I can't just convert the whole sheet.I also am aware that if I convert the datetime to an nvarchar(10) it does keep the date in Excel, but not as datetime, just a general format.So, am I missing a simple QueryTable option that would do this for me automatically?
View 2 Replieswith a function to redim preserve a multidimensional array (2d) and change both dimensions, also it would be a
View 3 RepliesI have been learning about OOP and classes from a book and one of the question is the book has asked to create a simple Saving/Checking accounts Program. The question says that most of the functionality must be done through an Accounts Class, and this Acoounts class must inherit certain private fileds from an base class 'Transaction.
The question also says that data from the Saving/Checking accounts Program must be read to and from a text file, and these functions must be done within the Acounts class.
i have done everything the question asks to the best of my knowlegde and understanding but when it comes to storing and retieving data from the textfile i cannot utilise the array i created to store the textfile data onto it.
Bank Account.Write a program to maintain a person's Savings and Checking accounts. The program should keep track of and display the balances in both accounts, and maintain a list of transactions (deposits, withdrawals, fund transfers, and check clearings) separately for each account. The two lists of transactions should be stored in sequential files so that they will persist between program sessions.
Consider the form in Figure 11.12. The two dropdown combo boxes should each contain the items Checking and Savings. Each of the four group boxes corresponds to a type of transaction. (When Savings is selected in the Account combo box, the Check group box should disappear.) The user makes a transaction by typing data into the text boxes of a group box and pressing the button. The items appearing in the Transactions list box should correspond to the type of account that has been selected. The caption of the second label in the Transfer group box should toggle between "to Checking" and "to Savings" depending on the item selected in the "Transfer from" combo box. If a transaction cannot be carried out, a message (such as "Insufficient funds") should be displayed.
The program should use two classes, Transaction and Account. The class Transaction should have properties for transaction name, amount, date, and whether it is a credit (deposit) or debit (withdrawal/check). The class Account, which will have both a checking account and a savings account as instances, should use an array of Transaction objects. In addition, it should have properties for name (Checking or Savings) and balance. It should have methods to carry out a transaction (if possible), to display the list of transactions, and to load and retrieve the set of transactions into or from a sequential file. The events InsufficientFunds and TransactionCommitted should be triggered at appropriate times.
Hint: In order for an Account object to display a list of transactions, a list box should be passed to a method as an argument. The method might be declared with Sub EnumerateTransactions(ByVal lb As ListBox).
Here is my code. I am sorry this code is basic and unedited.
Public Class Form3
'load contents of Text file into the listbox when first loaded
'store data in file into array of accounts, record no. counts
[code]....
I am writing out a CSV file in a VB.NET Windows Application. It is a string, like this:99,Company,00666,TBDOn another form, the user can browse to this file and open it.When he does, I use the Microsoft Jet OleDB provider and read this file into a datagridview. It displays the four columns in the grid, but it truncates the two leading zeroes on 00666 and displays 666.I need those leading zeroes. I tried writing out the string like this:99,Company,'00666,TBD(notice the leading single quote before 00666, like you would type in an Excel cell to indicate it was text), but then when the four columns are displayed in the grid, I have the single quote and the two leading zeroes. I don't want the single quote, I just thought I could use it to indicate text.So my question is how can I write out a string of leading zeroes and have them read into the grid preserved?
View 10 RepliesI have some XML like this:[code]...
Here is the problem. I lose the <p>, <strong>, <br /> and other HTML tags inside the <story> tag whenever I take the substring. Is there any way to get the first 500 characters of the story tag while keeping the inner HTML tags?
Is there a way to open an CSV file in excel completely as text so my leading zero's don't fall away.
It needs to be done in vb.net and it neets to be opened in excel 2007 or later.