|
You can't communicate with the card. It's considered media, not a device.
The card read/write is the device.
But that's neither here nor there. When inserted, the contents of the card will be exposed as part of the file system, usually a FAT32 volume. You can use any of the normal file/volume operations to get at the card.
|
|
|
|
|
I want to read it as a binary file all of it this will help me get to where i want in the file.
any Ideas on how to do that?
thx a lot.
BiG RaLpH
|
|
|
|
|
Use the normal I/O operation to read the file inside the SD. Use the object File under the namespace System.IO
Byez
|
|
|
|
|
Hello every one
Can any one plz let me know how to find the row index of selected cell / current cell
I have to add some text in the current or selected row's specific column once the index of the combobox (outside the grid) is changed by the user.
Regards
Nishkarsh
|
|
|
|
|
If you are using a DataGridView or something similar you can usually access the SelectedCells() property. SelectedCells(0).RowIndex gives you the row index of the first selected cell.
Volker Weichert
|
|
|
|
|
hi all
thanks for previous reply.
I have another qurey.I serched lot for this ,but did't get proper solution.
Actully in my application m using vb.net2003 and access.On one form I have used tabcontrol with 2 tabpages.On 1st tabpage there is list view.I wt i want is ,when i click on any item the text of that item should display on textbox of another tabpages.To get text value of item i wrote several code like
[code]
Dim item As ListViewItem
Dim column As Integer
MessageBox.Show(item.SubItems(0).Text)
or
MsgBox(LstRecord.SelectedItems(1).Text)
or
MsgBox(LstRecord.SelectedItems(1).SubItems(2).Text)
or
l1.Text = LstRecord.SelectedItems(3).Text.ToString
or
MsgBox(e.Item.ToString)
[/code]
it fails every time.Plz help me.
poonam
|
|
|
|
|
What error do you get?
The following could be issues with your code:
poonams wrote: MessageBox.Show(item.SubItems(0).Text)
item is not instantiated
poonams wrote: MsgBox(LstRecord.SelectedItems(1).Text)
or
MsgBox(LstRecord.SelectedItems(1).SubItems(2).Text)
or
l1.Text = LstRecord.SelectedItems(3).Text.ToString
Most likely the maximum array subscript of SelectedItems is less than 1, ie., you have only selected 1 item from the list.
|
|
|
|
|
I currently using VB.NET and RichTextBox Control, when i want to save the data it works properly, but why the cursor move to the top?
Thanks
Socheat
|
|
|
|
|
Try some thing like this which i use for the multi line text box
txt_box.SelectionStart = 0
txt_box.SelectionStart = Len(txt_box.Text)
txt_box.ScrollToCaret()
Good luck
|
|
|
|
|
Your code i think it not work properly because the cursor will be go to buttom of TextBox control,
I mean whereever cursor focus after saved it still focus the same place.
Thanks
Socheat
|
|
|
|
|
I have made a small software which requires .Net framework 2.0 and Sql server Express 2005.I want to make a setup file which automatically installs these two components.
How can i achieve this??
|
|
|
|
|
You can use some tools to create the setup.
|
|
|
|
|
There are tools like INO setup which are under GNU license..
You can download them...
I had used it to do some...
|
|
|
|
|
I have to take back up and restore my database in VB.NET2003 & SQL SERVER 2000. I don't know back up & restore coding. Please send me the coding.
_vaani_
|
|
|
|
|
Hi Vaani,
I do not have expertise on restoring SQL Server database programmatically. Howerver, you may try following code snippet to take backup of a SQL SERVER database from a remote machine. You will need to compile it and change the values to reflect your server.
BEGIN CODE
Imports System
Imports System.Data
Imports System.Collections
Imports Microsoft.SqlServer.Management.Common
Imports Microsoft.SqlServer.Management.Smo
Class Program
Private Shared Sub Main(ByVal args As String())
Dim bdi As New BackupDeviceItem("AdventureWorks.bak", DeviceType.File)
Dim bu As New Backup()
bu.Database = "AdventureWorks"
bu.Devices.Add(bdi)
bu.Initialize = True
AddHandler bu.PercentComplete, AddressOf Backup_PercentComplete
AddHandler bu.Complete, AddressOf Backup_Complete
' add percent complete and complete event handlers
Dim server As New Server("localhost")
bu.SqlBackup(server)
Console.WriteLine(Environment.NewLine + "Press any key to continue.")
Console.ReadKey()
End Sub
Protected Shared Sub Backup_PercentComplete(ByVal sender As Object, ByVal e As PercentCompleteEventArgs)
Console.WriteLine(e.Percent + "% processed.")
End Sub
Protected Shared Sub Backup_Complete(ByVal sender As Object, ByVal e As ServerMessageEventArgs)
Console.WriteLine(Environment.NewLine + e.ToString())
End Sub
End Class
END CODE
I hope this would be helpful .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi all,
I'm currently doing a contract and vendor windows form application.
I have no problem creating reports, i.e listing contracts and vendors by their specialisation.
But now, I have one problem - I do not know how to do a report which list contracts due for renewal in 3 months. The thing is I have already did a search function in a form which would list the contracts due for renewal in 3 months, using the query builder(which reflects under ContractTableAdapter). However, my previous reports are created by drag and drop of dataset's attributes into report designer (dragged Toolbox's ReportViewer and created a new report).
For contracts due for renewal, I do not have any dataset to drag and drop. (?)
My "Contract" table containing the following fields:
Contract_ID INT NOT NULL,
Vendor_ID INT NOT NULL,
DateStart datetime,
DateDue datetime,
PRIMARY KEY(Contract_ID),
FOREIGN KEY (Vendor_ID) REFERENCES Vendor(Vendor_ID)
I hope I convey what I wanted to say correctly. Any help is greatly appreciated. Thanks!
telly
p.s I already an alternative in mind, which is done not really in a report way.
|
|
|
|
|
How are you creating reports ? It sounds to me like you've got to the point of needing to learn SQL.
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 )
|
|
|
|
|
Hi Graus,
Thanks for the reply.
But what is wrong with the SQL (btw, the SQL statements are used for MSSQL)? Don't mind can you say in more detail instead of just a one-liner. I really do not know where the SQL went wrong. I'm currently a beginner in SQL and VB.net but I do make an attempt in trying before asking, and learnt along the way.
I created reports using this. I followed the steps exactly (the only difference is probably the database attributes).
Meticulous advise, please? Appreciated. thanks.
telly
|
|
|
|
|
It sounds to me like you're creating reports by dragging and dropping in some tool. SQL functions like GetDate allow you to write SQL that checks a date against a known value, but you would need to write your own SQL for that, not use a tool that generates it.
I have never used the report viewer control, I didn't know it existed.
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 )
|
|
|
|
|
I'm assuming you use the crystal reports version that is embedded in visual studio 2005
since you already are able to display the records on a form I'm also asuming you can find the sql query needed for this
if both asumtions are correct this might be a way to do what you want:
you create a new report (add --> crystal report)
in the database expert of that report (tab data) you can select you'r database then you get the option to add a table or a command
choose command
now you can enter an sql query wich will be used to create the report
do some layout on the report as you see fit
then on you'r form do the following:
<br />
sub btnprint.click<br />
Dim rpt As New ProjectVoorblad()<br />
rpt = reconnectreport(rpt)<br />
Dim dt As New DataTable()<br />
dt = FILLDTWITHYOURSQLQUERY<br />
rpt.SetDataSource(dt) 'this will only work if there is only 1 command and 0 tables in the report <br />
crvMain.ReportSource = rpt 'crvmain = crystal reports vieuwer<br />
end sub<br />
<br />
Private Function reconnectreport(ByVal report As ReportDocument) As ReportDocument<br />
Dim connection As IConnectionInfo<br />
Dim oldServerName As String = report.DataSourceConnections(0).ServerName<br />
Dim newServerName As String = sservername<br />
Dim oldDatabaseName As String = report.DataSourceConnections(0).DatabaseName<br />
Dim newDatabaseName As String = sdbname<br />
Dim userID As String = susername<br />
Dim password As String = spass<br />
report = report<br />
' Change the server name and database in main reports<br />
For Each connection In report.DataSourceConnections<br />
If (String.Compare(connection.ServerName, oldServerName, True) = 0 _<br />
And String.Compare(connection.DatabaseName, oldDatabaseName, True) = 0) Then<br />
' SetConnection can also be used to set new logon and new database table<br />
report.DataSourceConnections(oldServerName, oldDatabaseName).SetConnection( _<br />
newServerName, newDatabaseName, userID, password)<br />
End If<br />
Next<br />
' Change the server name and database in subreports<br />
Dim subreport As ReportDocument<br />
For Each subreport In report.Subreports<br />
For Each connection In subreport.DataSourceConnections<br />
If (String.Compare(connection.ServerName, oldServerName, True) = 0 _<br />
And String.Compare(connection.DatabaseName, oldDatabaseName, True) = 0) Then<br />
' SetConnection can also be used to set new logon and new database table<br />
subreport.DataSourceConnections(oldServerName, oldDatabaseName).SetConnection( _<br />
newServerName, newDatabaseName, userID, password)<br />
End If<br />
Next<br />
Next<br />
Return report<br />
End Function<br />
the reconnectfunction reconnects you'r report to the correct database (if it changed)
if the connection to you'r database never changes you don't really need to do this
hope this helps
if you need more explenation let me know
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Hi TD, thanks for the reply.
Your assumptions:
1) I use ReportViewer (am using Microsoft Visual Studio 2005 btw) from the Toolbox to create reports. I do not use Crystal Report (I just use Windows Form).
2) Do you mean the SQL select query for listing contracts due for renewal in 3 months? If so, yes I know the query.
SELECT Contract_ID<br />
FROM Contracts<br />
WHERE DateDue BETWEEN GetDate() AND DateAdd(mm, 3, GetDate())
Do you have any idea how to do a report which list contracts due for renewal in 3 months (which is not one of the database attribute)?
Previously how I created my report(drag and drop):
like this
Can you help me please? Thanks in advance.
telly
|
|
|
|
|
first sorry for the late reply but I didn't have access to the internet this weekend
for you'r problem:
I'v never used your way of creating reports but from the looks of it its some sort of spin-off from crystal reports.
If you want to continue using this way my sugestion would be to create a dummy dataset (with you'r sql in it) then before you call the report you fill the dataset with the correct data that way you can keep using this drag and drop methode
I think that with the sql query you provided you don't even have to fill the dataset it will always be correct (if the table doesn't change and the date to look from is always the current date) so you should be able to create the dataset and use it like any other
if that doesn't work I suggest looking into crystal reports it will accomplish alot more and is free (at least the one embedded in visual studio is)
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
Hi everyone,
Here I have a strange problem.
I am working on a console application.
I use the following code to print : Welcome
console.writeline("Welcome")
Now I want to print: "Welcome"
I want to print it with quotes. but ,
console.writeline(" "Welcome" ") gives me an error.
So, what to do to print a word with quotes??
Thanks For any help,
Dan
|
|
|
|
|
Not strange at all. How would the compiler know when " means a quote you want to print, or when it means a quote, in the usual sense ?
console.writeline("\"Welcome\"")
Assuming it works the same as C#. f not, you'll have to google to find the VB syntax.
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 )
|
|
|
|
|
For VB you can use console.writeline("""Welcome""")
|
|
|
|