|
Hello. I have an an application on a handheld that reads rfid and stores the result in a txt file. all good so far. i read thefile in order to save it into sql server. but i am having a big error.
Here is my code. Is there anything wrong with it?
The error is in the comment. because it's a long error.
Public Function ChangeFormat(ByVal dtm As String) As Date
Dim temp As String = ""
temp = Mid(dtm, 4, 2) & "/"
temp = temp & Mid(dtm, 1, 2) & "/"
temp = temp & Mid(dtm, 7, 4) & " "
temp = temp & Mid(dtm, 12)
ChangeFormat = CDate(temp)
End Function
Private Sub cmdimport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdimport.Click
Try
If connect2008() = True Then
If MsgBox("Do you want to export data to server?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Dim _cmd As New SqlCommand("", connchip)
Dim i As Integer = 0
Dim strsql2 As String = ""
Dim tmp As String = ""
Dim ln() As String
Dim f As New System.IO.StreamReader("\ticketpro\export\" & Format(Now, "yyyyMMdd") & "HH.txt")
While Not f.EndOfStream
tmp = f.ReadLine
ln = tmp.Split(",")
strsql2 = "insert into handheld ("
strsql2 = strsql2 & "dat, "
strsql2 = strsql2 & "ticketnum, "
strsql2 = strsql2 & "stationid, "
strsql2 = strsql2 & "hhid, "
strsql2 = strsql2 & "status) values ("
strsql2 = strsql2 & "'" & ChangeFormat(ln(1)) & "', "
strsql2 = strsql2 & "'" & ln(2) & "', "
strsql2 = strsql2 & ln(0) & ", "
strsql2 = strsql2 & ln(4) & ", "
strsql2 = strsql2 & "'" & ln(3) & "') "
_cmd = New SqlCommand(strsql2, connchip)
_cmd.ExecuteNonQuery()
End While
_cmd.Dispose()
f.Close()
f.Dispose()
connchip.Close()
MsgBox("Export Done")
Else
MsgBox("Server not in range")
End If
End If
Catch ex As Exception
MsgBox("import error " & ex.ToString)
End Try
End Sub
Public Function connect2008() As Boolean
connect2008 = False
Dim path As String
Dim database As String
Dim temp As String = ""
Dim temp2(15) As String
Dim server As String
Dim FileReader As StreamReader
FileReader = New StreamReader("\ticketpro\chip.txt")
temp = FileReader.ReadToEnd()
temp2 = Split(temp, ",")
FileReader.Close()
database = temp2(8)
server = temp2(7)
path = "Data Source=eazzi-pc\SQLEXPRESS2012;Initial Catalog=ticketprozaarour; User Id=system; Password=startup;"
Try
connchip = New SqlConnection(path)
connchip.Open()
connect2008 = True
Catch ex As Exception
connect2008 = False
MsgBox("error in function connect 2008")
End Try
End Function
Private Sub TImageButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TImageButton1.Click
Me.Close()
End Sub
End Class
One more thing. he handheld is connected to wifi. and the pc eazzi-pc is connected to the same wifi.
|
|
|
|
|
{\pwd2\ansi{\*\pwdcomment
************************************************************************
*
* This is a Microsoft WordPad document.
*
* For further details visit the Microsoft Windows CE web site, at
* http://www.microsoft.com/windowsce
* Or search MSDN for
*
************************************************************************
}\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}}
{\colortbl ;}
\viewkind4\uc1\pard\cf0\f0\fs20 System.Data.SqlClient.SqlException: SqlException\par
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, TdsParserState state)\par
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, TdsParserState state)\par
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()\par
at System.Data.SqlClient.TdsParser.Run(RunBehavior run, SqlCommand cmdHandler, SqlDataReader dataStream)\par
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()\par
at HomePro_231.importexportfrm.cmdimport_Click(Object sender, EventArgs e)\par
at System.Windows.Forms.Control.OnClick(EventArgs e)\par
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)\par
at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)\par
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)\par
at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)\par
at System.Windows.Forms.Form.ShowDialog()\par
at HomePro_231.valetfrm.TImageButton1_Click(Object sender, EventArgs e)\par
at System.Windows.Forms.Control.OnClick(EventArgs e)\par
at System.Windows.Forms.Control.WnProc(WM wm, Int32 wParam, Int32 lParam)\par
at System.Windows.Forms.ContainerControl.WnProc(WM wm, Int32 wParam, Int32 lParam)\par
at System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)\par
at Microsoft.AGL.Forms.EVL.EnterModalDialog(IntPtr hwnModal)\par
at System.Windows.Forms.Form.ShowDialog()\par
at HomePro_231.mainmdl.main()\par
}
|
|
|
|
|
Solved. The code is correct I had a missing field in the table handheld in my database.
|
|
|
|
|
I tried to change the flash banner text from 50% to 60% and its only show 60% in Desktops not in mobile.
Please let me know if any one have the solution detail and steps of how to fix it
modified 4-Feb-14 4:00am.
|
|
|
|
|
|
Your question does not contain enough information to warrant any meaningful help.
Which mobile? Android or Windows Phone or iPhone or anything else?
|
|
|
|
|
all the mobile because website is compatible for all the devices
|
|
|
|
|
Where's the code? Without complete details, we can't even guess. Include those details in your question. I think you should try something like this[^]
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
i think you have to use media query
|
|
|
|
|
HI i have window 7 on my pc. want to know which sdk / framework do i need to install to start working on mobile development. my main focus is to learn mobile website and then mobile native application.
Ravi Khoda
|
|
|
|
|
|
Thanks, useful
Ravi Khoda
|
|
|
|
|
Good link for windows mobile
|
|
|
|
|
Dear Friends,
I have list of mp3 files that I would like to merge them into one file. I downloaded files locally into isolated storage, but I have no idea how to merge them. google doesn't help either. I don't know if its possible in wp8. (2) If not possible what specific solution you could advice (I also have my files in web).
Thanks!
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Dear friends, I have bounded pivot items using collection which works fine. Now I want to remove individual pivot item when selection changes.
private void myPivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count > 0)
{
//Remove old Items
// Add New Item to Page collection (Pages.Add())
//Show only 1 pivot item (Users should see other pivot item headers)
}
}
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
HI,
How to draw a straight line 3 cm?
Tell me the class and Function .
Thank you!
windows phone7 or windows phone 8
|
|
|
|
|
|
Dear All,
I have below code (Just for text purpose)
<ScrollViewer VerticalScrollBarVisibility="Visible">
<TextBlock x:Name="txt" Foreground="White" FontSize="40"/>
</ScrollViewer>
and c#
for (var i = 0; i < 50; i++)
txt.Text += counter++ + Environment.NewLine;
It prints upto 43 lines (counter), However there is a scroll, but i cannot see the remaining text.
I dont know what is the issue with textblock (does it accept only 43 lines or more?)
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
|
hi, developing mobile sample application in vs2008 and db as SQLite.
System.MissingMethodException was unhandled
Message: The version of the assembly System.Data, Version=3.9.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC cannot be loaded by this version of the Microsoft .NET Compact Framework.
version conflict version is raising in need help in this problem. very urgent.
thanks in advance.
Have A Nice Day!
Murali.M
Blog
|
|
|
|
|
hi developing an sample mobile application in vs2008 and SQLite db. frequently this error occurred.
Deployment and/or registration failed with error: 0x8973190e. Error writing file '%csidl_program_files%\samplemob\system.dll'. Error 0x80070070: There is not enough space on the disk.
Device Connectivity Component
any one help to resolve this problem.
thanks in advance.
Have A Nice Day!
Murali.M
Blog
|
|
|
|
|
Dear All,
I am developing Windows Phone 8 App in c# and i have followed
http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh202978(v=vs.105).aspx[^]
When Playing file, there is 1-3 seconds delay in playing each Mp3 file.
I am looking to remove this delay or play next track (next mp3 file) before reaching just to an end.
Google does not help a lot
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Hi,
this is a code sample that can help you :
private HttpWebRequest request;
private Mp3MediaStreamSource mss;
private string mediaFileLocation =
@"http://media.ch9.ms/ch9/755d/4f893d13-fa05-4871-9123-3eadd2f0755d/
EightPlatformAnnouncements.mp3";
public MainPage()
{
InitializeComponent();
Get = (ApplicationBarIconButton)ApplicationBar.Buttons[0];
Play = (ApplicationBarIconButton)ApplicationBar.Buttons[1];
Pause = (ApplicationBarIconButton)ApplicationBar.Buttons[2];
}
private void Get_Click(object sender, EventArgs e)
{
request = WebRequest.CreateHttp(mediaFileLocation);
request.AllowReadStreamBuffering = true;
request.BeginGetResponse(new AsyncCallback(RequestCallback), null);
}
private void RequestCallback(IAsyncResult asyncResult)
{
HttpWebResponse response =
request.EndGetResponse(asyncResult) as HttpWebResponse;
Stream s = response.GetResponseStream();
mss = new Mp3MediaStreamSource(s, response.ContentLength);
Dispatcher.BeginInvoke(() =>
{
mp3Element.SetSource(mss);
Play.IsEnabled = true;
Get.IsEnabled = false;
});
}
private void Play_Click(object sender, EventArgs e)
{
mp3Element.Play();
Play.IsEnabled = false;
Pause.IsEnabled = true;
}
private void Pause_Click(object sender, EventArgs e)
{
mp3Element.Pause();
Pause.IsEnabled = false;
Play.IsEnabled = true;
}
Thanks
|
|
|
|
|
Thanks for the reply, I am storing files locally and I am using BackgroundAudioPlayer instead of Streaming.
(I didnt understand mp3Element, object of?)
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Many Thnaks for your nice message.
So Having set up the projects, you can then declare an Mp3MediaStreamSource object. The sample
app fetches a remote MP3 file by using an HttpWebRequest. When we get the data back, we use it to
initialize the Mp3MediaStreamSource and set that as the source for a MediaElement object, which is
declared in XAML.
Thanks.
|
|
|
|