Storing SMS To My SQL Database..help Guys!!!

May 8, 2007

i use a teltonika t-modem gsm modem..

it's quite new actually and it is connected to my PC thru a usb port..



my problem now is that

i can,t seem to get the hang in storing received messages in

my SQL database..

the code goes like this..

a receive button is clicked to generate an instance

where all SMS sent to my sim card would then be accessed by my gsm modem..



private void btnReceive_Click(object sender, EventArgs e)

{

ListViewItem Component;

Cursor c = Cursor.Current;

Cursor.Current = Cursors.WaitCursor;

listView1.Items.Clear();

btnReceive.Enabled = false;

objGsmIn.Device = cmbDevice.SelectedItem.ToString();

objGsmIn.LogFile = txtLogging.Text;

if (cmbDeviceSpeed.SelectedIndex == 0)

{

objGsmIn.DeviceSpeed = 0;

}

else

{

objGsmIn.DeviceSpeed = System.Int32.Parse(cmbDeviceSpeed.Text);

}

objGsmIn.Storage = fMsgStore.MsgStorage;

if (fMsgStore.DelMsg == true)

{//deletes your message after receiving

objGsmIn.DeleteAfterReceive = 1;

}

objGsmIn.Receive(); //this checks your new incoming messages

if (objGsmIn.LastError == 0)

{

objGsmIn.GetFirstMessage();

while (objGsmIn.LastError == 0)

{

//continously receive all messages..

Component = listView1.Items.Add(objGsmIn.MessageSender);

Component.SubItems.Add(objGsmIn.MessageData);

objGsmIn.GetNextMessage();

}

txtResults.Text = "Messages Successfully Received..";

}

else

{

//error in message receiving process..

txtResults.Text = "Error " + objGsmIn.LastError + "(" + objGsmIn.GetErrorDescription(objGsmIn.LastError) + ")";

}

btnReceive.Enabled = true;

Cursor.Current = c;

}



now my problem is that i cant figure out where i would place my stored procedure

in storing those messages to my database..



the problem is that..

if i place my stored procedure on the 1st "IF" statement..

it will only save my 1st incoming message..



but another thing is that if i put it under my "WHILE" statement..

dont you think that it will continiously loop?

meaning to say that the next tym i tried to access all my received messages

it would definitely store all the previously read messages again to my database..

which then creates multiple copies of my previously stored messages again and again



well i hope you get the gist of what i mean..

its quite complicated to explain..

but then again thanks a lot for taking notice on my post regarding this..

thanks!!^_^



another thing..i used the active xperts c# application in order to

create this application..

View 2 Replies


ADVERTISEMENT

How Do I Insert These Data Into Database Guys???

Jan 3, 2008

 
Hii Folks
This is my Table Order(OrderNo, CartID, TotalAmount, Name, City, Email, Zip, Date), Then I have my code which I need to insert data into database, but OrderNo is automatically inserted
this is my code, but when I run it it shows the error page, if I remove the direction to my error page, it does not show anything and I don't see any error, could any one check for it please
Imports System
Imports System.Data.SqlClientPartial Class Checkout
Inherits System.Web.UI.PageProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadAmountLabel.Text = Session("OrderTotal").ToString()
SessionLabel.Text = Session.SessionID.ToString()
End SubProtected Sub ContinueButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContinueButton.Click
Dim shopp As New SqlDataSource()shopp.ConnectionString = ConfigurationManager.ConnectionStrings("SHOESConnectionString").ConnectionString
shopp.InsertCommandType = SqlDataSourceCommandType.Text
shopp.InsertCommand = "INSERT INTO Order(CartID, TotalAmount, Name, City, Email, Zip, Date) VALUES (@CartID, @TotalAmount, @Name, @City, @Email, @Zip, @Date)"shopp.InsertParameters.Add("CartID", SessionLabel.Text)
shopp.InsertParameters.Add("TotalAmount", AmountLabel.Text)shopp.InsertParameters.Add("Name", NameTextBox.Text)
shopp.InsertParameters.Add("City", CityTextBox.Text)shopp.InsertParameters.Add("Email", EmailTextBox.Text)
shopp.InsertParameters.Add("Zip", ZipTextBox.Text)shopp.InsertParameters.Add("Date", DateTime.Now()) Dim rowaffected As Integer = 0
Try
rowaffected = shopp.Insert()Catch ex As Exception Server.Transfer("ErrorPage.aspx")
End Try
shopp = Nothing
If rowaffected <> 1 ThenServer.Transfer("ErrorPage.aspx")
ElseServer.Transfer("success_shopping.aspx")
End IfEnd Sub
End Class

View 6 Replies View Related

Which Is Better? Storing Data In The Database OR Storing It In The File System

Dec 29, 2006

Hello there,I just want to ask if storing data in dbase is much better than storing it in the file system? Because for one, i am currenlty developing my thesis which uploads a blob.doc file to a web server (currently i'm using the localhost of ASP.NET) then retrieves it from the local hostAlso i want to know if im right at this, the localhost of ASP.NET is the same as the one of a natural web server on the net? Because i'm just thinking of uploading and downloading the files from a web server. Although our thesis defense didn't require us to really upload it on the net, we were advised to use a localhost on our PC's. I'll be just using my local server Is it ok to just use a web server for storing files than a database?    

View 6 Replies View Related

Designing A Database Within A Database... Design Question Storing Data...

Jul 23, 2005

I have a system that basically stores a database within a database (I'msure lots have you have done this before in some form or another).At the end of the day, I'm storing the actual data generically in acolumn of type nvarchar(4000), but I want to add support for unlimitedtext. I want to do this in a smart fashion. Right now I am leaningtowards putting 2 nullable Value fields:ValueLong ntext nullableValueShort nvarchar(4000) nullableand dynamically storing the info in one or the other depending on thesize. ASP.NET does this exact very thing in it's Session State model;look at the ASPStateTempSessions table. This table has both aSessionItemShort of type varbinary (7000) and a SessionItemLong of typeImage.My question is, is it better to user varbinary (7000) and Image? I'mthinking maybe I should go down this path, simply because ASP.NET does,but I don't really know why. Does anyone know what would be the benifitof using varbinary and Image datatypes? If it's just to allow saving ofbinary data, then I don't really need that right now (and I don't thinkASP.NET does either). Are there any other reasons?thanks,dave

View 7 Replies View Related

BRAINTEASER For All You SQL Guys!

Apr 19, 1999

Hi all!

Steve suggested I post my question here because this is where all the "experts" reside who like a little challenge. I'll simplify my problem down to two example tables with two fields each for the purpose of solving this "hard part". My only requirement for the solution is that it has to be a SQL only solution (no stored procs) as my client can only run Access - yuck...

Here's the deal. There are two tables, PEOPLE and JOBS. They look like this:

PEOPLE Table:

ID NAME
------ ------
1 Adam
2 Bill
3 Carl
4 Dave

JOBS Table:

DESC ASSIGNED_TO
----- -----------
Clean 1
Wash 2,3
Dry 2
Polish 1,3,4

I want to report which people are assigned to which jobs as shown. One line per job with the names concatenated with commas in between:

Clean Adam
Wash Bill,Carl
Dry Bill
Polish Adam,Carl,Dave

All four fields are TEXT fields in this design, but they don't have to be. I have full control over the database, fields, types, etc. If there's a better way then just suggest it. As you can see, the "ASSIGNED_TO" field is a concatenation of the IDs. Goal is just to report the DESC and people's NAMEs.

How about it? Any slick way of doing this? Played around with using SubQueries, IIF, LIKE on ID and ASSIGNED_TO, and came close but never got it all.

I appreciate any tips or suggestions. Thanks a bunch!

John

View 2 Replies View Related

Guys Atleast Help Me In This One

May 15, 2008

I have a table with values

id diff
1 5
2 10
5 5
6 15
7 20
8 10
10 5
11 10
12 15

I need a sum of such records whose id are continous.I mean the output should be

id sum
2 15
8 50
12 25

Id 1 & 2 are continous so it is added.But after 2 the next number is not 3 so it wont be in the sum of 1 & 2.From 5 to 8 numbers are continous so those diff are added & so on.

View 12 Replies View Related

Hey Guys (QUESTION)

Jan 10, 2007

My question is can anybody explain Cascade Update and Deletes and plz tell me like i am your student. Thanks in Advance
Danny D

View 3 Replies View Related

Help With Query Guys..

Nov 3, 2007

I have these queries

SELECT sum(cantidad) AS suma FROM Movimiento WHERE ID=[puntp] AND id_sorteo=[sorteo] AND tipo="Entrada";
SELECT sum(cantidad) AS resta FROM Movimiento WHERE ID=[puntp] AND id_sorteo=[sorteo] AND tipo="Salida";


I want to join in one simple query and i want to display the result of suma-resta

Thnk you ! i hope u can help me, I'm going to explode my brain hehe

View 4 Replies View Related

Reeeeeally Easy For You Guys!

Jan 5, 2004

can someone post me an example trigger where.. inserting a new record in one table, creates a new record in another table with a new unique identifier incrementing by 1 from the last record.

so that I can edit it to suit my own work like:

eg. when I insert new person into people table, using a person_no as key.
= creates new pay record in pay table ith a pay_id as key like '0004' 1 more than the last record if it was '0003', and then adds that new person_no to the record for reference.

I know this is a really easy trigger, but it would be my first! Any example to edit would be great! thanks in advance

View 4 Replies View Related

Guys Please Please Help! Saving Cyrillic In My SQL DB HOW????????

Oct 25, 2007

Ok i've tried everything setting table collation to cyrillic setting the whole table language settings to Russian nothing works-i can only save ?????? instead of Russian symvols.(yes datatype is ntext not just text) I can directly input Russian letters from EMS SQL manager, and it will be ok, and i can even read it on my pages. But even if i try to execute SQL command through EMS manager (as opposite to just typing in the data) it will give me ????? again. If I save my ASP.net page in unicode it will give me ?? with some weird ` types symbols-but 70% of symbols would still be ????. I have already spend 45 hours googling and browsing forums but i still cannot solve it! I am so frustrated!
MS SQL Server 2005 Framework 2 ASP.net code looks like Win XP sp2


using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.HtmlControls;

using System.Data.Odbc;

using System.Data.SqlClient;

public partial class registration : System.Web.UI.Page

{



private const string ConnStr = "server=(local);database=main;Trusted_Connection=yes";

private const string ConnStr = "server=(local);database=main;Trusted_Connection=yes";

private void Page_Load(object sender, System.EventArgs e)

{



SqlConnection myConnection = new SqlConnection("server=(local);database=main;Trusted_Connection=yes;");

///ыуаыпвараеоеаореавп is russian random letters

SqlCommand myCommand = new SqlCommand("UPDATE quest SET Name='ыуаыпвараеоеаореавп' WHERE id=1", myConnection);

myConnection.Open();





SqlDataReader dr = myCommand.ExecuteReader();

myConnection.Close();


if i manually stop the script here and look at my dr variable i will see exactly sql command that i wrote (with no ????) but after execution in my database it is still ??????????????????????????????
Best Regards

View 6 Replies View Related

I Need Desperate Attention........please Guys

Mar 29, 2007

hello ppl.......

've installed sql 2005 xpress with advanced services......also installed the toolkit that came along..

all 'm interested in is to perform certain data mining operations on the adventureworks db..

;ve also installed the advn works db.........

now here is the prob.......

jus like how the sql online book instructed me i first started off with the datamining tutorial..where i was told to first OPEN BIDS select new PROJECT then make sure that the analysis Services template was selected and then go ahead with selection of the particular sln file....

the problem is that I DON'T SEE ANY ANALYSIS SERVICE TEMPLATE....all i c is a REPORT template..

i really need help guys..... 'm new to .net really feeling helpless...

please hurry guys....

thx a ton..

hanish

View 5 Replies View Related

Storing XML In Database

Jul 20, 2012

best way to store questionnaire data in a database.Since different questionnairs have different questions and formats i.e dropdown, radio, checkboxes etc building such a database model becomes highly complex.

I've read that if data schema is complex and higly variable it may be better to use an xml document and store that in a databse. However I dont quite understand how you store xml to a database. Do you simply store the entire structure in something like a nvarchar column or is there some other way to store xml to a database.

If you store the entire structure to the databse then how do you query the content to generate reports.

example xml:

Code:
<survey>
<meta>
<id>sample</id>
</meta>
<questions>
<question id="1" type="singlechoice" page="1">

[code]...

View 3 Replies View Related

Parent Package Configurations...or Not...What Do You Guys Do?

Jan 7, 2008



Finding myself in a bit of a lull at work, I'm trying to create some template packages / solutions, encapsulating some of the best practices that get discussed on here.


I'm thinking about passing configurations from Parent to Child packages, something we all must do on a regular basis. I've always done this a particular way, without thinking too much about it, but I'm not sure if this way is the best. I'd be interested in your opinions.

Scenario:

Parent.dtsx calls Child1.dtsx, Child2.dtsx etc, using Execute Package Task.
Parent has variable Source, and variable Destination, populated from a configuration (my preference is SQL table, but whatever).
These variables are ultimately used to populate the ConnectionString property of the source and destination Connection Managers of the Child packages.


Here's the question: Is it better for the Child packages to look up to their parent, and inherit the values of these variables through Parent Package Configurations, or to look directly to the configuration, and pick them up from there? Or does it not matter?

I tend to assign lots and lots of variables in Parent.dtsx, and pull them down into Child.dtsx with Parent Package Configs, but I'm thinking "is this good/bad/unimportant?"

View 7 Replies View Related

NOLOCK/ROWLOCK (good Or Bad Guys?)

Nov 9, 2007

Reading about avoiding deadlocks in SQL, I have found different opnions about whether using or not NOLOCK/ROWLOCK hints on SELECT/UPDATE/DELETE statements. I have several applications executing transactions on the same databases and tables, including inserts, updates and deletes. I wonder if by using NOLOCK/ROWLOCK I could decrease the chances of having deadlocks. At least using ROWLOCK on my update statements?. I just need some advice here.

Regards.

View 2 Replies View Related

Storing History In Database

Nov 25, 2003

Does anyone currently do this. I want to store an audit history for changes made in the database through our web application.

I would like some kind of history table structure. I would be interested to see if anyone else has done this and what your structure looks like.

ScAndal

View 1 Replies View Related

Storing Hh:mm:ss In Database Which Datatype?

Jan 13, 2004

I have a bit of a dilema, that maybe someone can give a reccomendation on. I have a vb app that will calculate a duration that a process runs in hours:minutes:seconds. My question is should I store this in the database as a date/time field or calculate total seconds and store it as an integer field? I will be using this field for basic summing calculations in the future. Thanks for any help.

View 1 Replies View Related

Storing Numbers In Sql Database

Feb 24, 2004

Hello-

Im currently storing an account id in a sql table. Is there any column data type that would presere the numbers but make it appear as a series of letters and nmumbers when someone looks at the database table?

If not can someone give me a strategy

thx

View 4 Replies View Related

Storing Files In Database

Dec 22, 2000

Hi,
can we keep a file like word file or html file in the sql server database?
if yes, then can we search any thing in these stored file?
regards
mihir

View 2 Replies View Related

Storing Image In Database

Dec 15, 2004

How do you store an image in a database? I know this is not the preferred method for storing images but would like to know anyways…thanks.

View 1 Replies View Related

Storing Images In The Database???

Sep 22, 2004

hello ... i have a project this semester and i had to study is storing images in a database ( using Microsoft Access ) is good or bad ? so any one could tell me the advantages and the disadvantages please ...
thanks
bye

View 5 Replies View Related

Storing Images In A Database

Oct 6, 2005

An odd question from me, I know, but this time, I assure you a twist.

I have a group that wants to store images in either a database or a file share, in order to make a certain website able to run on a load balanced web farm. These images are around 1KB each in size, and have a lifespan of exactly one use (think of graphs). I went a-googling, and found no shortage of articles that say "don't do it, but here's how you can do it", but I did not find any real hard statements as to why to not do it. Needless to say, this is hurting the case for not putting these images in the database. I have found an article that says images over 8KB will have worse performance, but I can not use that factoid here. For the moment, I have the developers leaning toward the fileshare, because they will be writing transaction logs all day, which will be more work than the fileshare needs to do....I think. The best I can do, is cut the text/image datatype overhead, and have them create the table as varbinary(2000), but even then, I don't like the look of the idea.

Anyone out there have good articles/whitepapers that detail the differences between writing single-use images to a fileshare vs. a SQL database? <baiting=blatant>Failing that, do any of the Microsoft development team have an opinion?</baiting>

Alternatively, what is the general opinion of keeping session state information in a database (because I bet that will be my next battle). I see .NET includes a session state server, but not being a programmer, I can not create an opbjective test.

View 5 Replies View Related

Storing Pictures In Database

Sep 13, 2007

Hy, could someone help me in this:In design mode, i want to put pictures in database. I made column namedpics, and its type as image. How can I put pictures or some address of thesepictures in that column, or i maybe need to put pictures in Add_Data folderand make reference from there, or what I need to do?could someone explain me that process of putting at least one picture indatabase, I'm using Microsoft SQL Server 2005thanks everyone

View 4 Replies View Related

Storing Passwords In Database

Jul 20, 2005

hi,I would like to store windows passwords and usernames in database.Please tell me where to start?What database can I use?Can I use free microsoft database?ThanksBart

View 6 Replies View Related

Storing Files In Database

Apr 10, 2008



Hey I currently have a foreach loop container working which scans a folder, loops through the files in this folder and then moves them to a new folder.

At the same time I also do an SQL insert into a table logging the details of the transfer.

What I would like to do next is to store the actual PDF in binary in my DB (varbinary format). How would I go about this ?

View 6 Replies View Related

Storing The Big File In SQL Database

Nov 5, 2007

How can I store the big files in the SQL Database, like MP3 files or an image or an video file?

View 3 Replies View Related

What Is The Use Of Storing Data In 2 Database ? And How To Do That ?

Mar 5, 2008





Can I know answer of this question ? in detail explanation.

View 1 Replies View Related

Can Xp_sendmail Be Made Into A Stored Procedure (was Hi Guys)

Jul 21, 2004

I have another question guys I need to send reports to different departments using sql. would this be the xp_sendmail function in sql. Can this be made into a stored procedure? What I'm going to do is make some reports which will constantly be updated with a query. These reports need to be emailed to differnt departments every 2 weeks. Is there a trigger or stored procedure I can setup through sql to do this? Does that make any sense??

View 8 Replies View Related

Storing The Image Urls In Database

Mar 29, 2007

hi friends,
i want to show images in repeater control dynamically.
i want to store the image url in database
like i have stored the images on onefolder c:images this will contain images
how can i store and use the urls in database
or atleast how can i show the images from the folder dynamically
please help me out

View 3 Replies View Related

Storing Checkbox Values To Database

Mar 19, 2008

Hi i am trying to store the checkbox values on my page to the database, but im stuck on what to do. I have the following code already;protected void Btn_Subscribe_Click(object sender, EventArgs e)
{SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["streamConnectionString"].ConnectionString);
string strSQL = "INSERT INTO Newsletter(emailAddress) VALUES (@emailAddress)";SqlCommand Command = new SqlCommand(strSQL, conn);
Command.Parameters.Add("@emailAddress", SqlDbType.VarChar);Command.Parameters["@emailAddress"].Value = txtEmail.Text;
conn.Open();
Command.ExecuteNonQuery();
conn.Close();
}
How do i now insert the values from my checkbox, this is how i am setting the checkbox;public void Page_Load(object sender, EventArgs e)
{ArrayList values;if(!IsPostBack)
{
//Build array of data to bind to checkboxlistvalues = new ArrayList();
values.Add("Sport");values.Add("Gardening");values.Add("technology");
AlertList.DataSource = values;
AlertList.DataBind();
}
If i am going about it the wrong way please let me know, thanks

View 15 Replies View Related

Best Method For Storing A Time In A Database

May 22, 2008

Hi,I have a table which I need to store times in. What is the best way of doing this? The only way I can think of so far is to save the times as a datetime such as '1/1/1900 03:00 PM' then format the date as "hh:mm tt" so that the day isn't displayed. Is this the best method?Thanks,Curt.

View 6 Replies View Related

Storing A XML File In A SQL Server Database

Jun 23, 2004

I have records with 50 plus fields of data.I was thinking of writing all the fields data into a XML file and then store it in a SQL server database for retrieval later on.Is there anyway i can go about doing this?

View 6 Replies View Related

Storing Rich Text In A Database

Jan 27, 2005

Hey folks,

Just a quick question to ask what is the best field to store the data held in a rich text box/control. Just want to make sure that i get it right first time you know. Not sure about the amount of characters that needs held but its going to be quite a lot as this field shall contain most of my pages content.

Appreciate any help

Thanks

Turklad

View 3 Replies View Related

Storing Arabic String In SQL Database

Apr 19, 2005

I am having a problem in a VB.NET application, i have a form that the user fills to store data in the database, the problem is that when i enter Arabic string, it gets stored in the database as question marks '??????'
The database field type is nvarchar, anybody went across this problem?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved