[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Jasim Iqbal

3/1/2002 4:40:00 AM

hi all,

i have a small problem .... i have installed MMIT and MME
3.0. now problem is when i'm viewing my application made
in MMIT .NET, it shows me the form but when i try to write
somethin in the textbox in my form it doesn't write
anythin from the Emulator key pads (i mean 1, 2, 3 .. etc.
buttons).

is teher any place i should check for this.

on emore thing i just installed MMIT 1.0 and MME but i did
not configure anything ... i do get option to create
Mobile Application when i create new project in .NET IDE,
and i do get Mobile Explorer Browser option in 'View' in
IDE .... does this shows i have installed it correctly ...

please do let me know if u have any suggestions or answers.

thanx
-jasim
4 Answers

(Michael Schaefer)

3/3/2002 12:12:00 AM

0

Jasim Iqbal

3/5/2002 8:50:00 AM

0

thanx michael for ur reply, actually meanwhile i already
found the problem ...

but i do have another question ..

i have made a selection list of type 'ListBox' .. now i
have to add cities name to the list from a database and
have to assign each cities_id from data base to the value
like ....

(HTML Code when viewed in IE browser)
<select size="8" name="slst1">
<option value3>Chatham
<option value4>Guelph
<option value0>Kitchener
<option value0>London
</select>

but instead i get following code ...

<select size="8" name="slst1">
<option value="Chatham">Chatham
<option value="Guelph">Guelph
<option value="Kitchener">Kitchener
<option value="London">London
</select>

my code for the control is as following ...

CODE c-Sharp (in the code Station_ID should be 'value' and
Station_Name should appear in the control to see)
******************************************

private void slst1_Load(object sender, System.EventArgs e)
{
#region Show Code
SqlConnection newmyConnection =
new SqlConnection("user
id=sa;password=sa;server=challenge360;Trusted_Connection=no
;databaseºckTest");
string mySelectQuery = "SELECT
Station_ID, Station_Name FROM tblStation_Info";
SqlCommand myCommand = new
SqlCommand (mySelectQuery,newmyConnection);
newmyConnection.Open();
SqlDataReader myReader;
myReader = myCommand.ExecuteReader
();

while (myReader.Read())
{
for (int i=0;
i<myReader.FieldCount; i++)
{
string dt;
dt =
myReader.GetDataTypeName(i);
if(dt == "decimal")
{

slst1.DataValueField = (myReader.GetDecimal
(i)).ToString();
}
if(dt == "varchar")
{

slst1.DataTextField = myReader.GetString(i);

slst1.Items.Add (myReader.GetString(i));
}
}//end for
Console.WriteLine();
}//end while

// always call Close when done
reading.
myReader.Close();

Console.WriteLine("The Values are
Shown!");
// Close the connection when done
with it.
newmyConnection.Close();
#endregion
}


Jasim Iqbal

3/7/2002 7:38:00 AM

0

hi michael,

thanx again for ur concern and reply. the code u have sned
is for WebForms not for MobileWebforms ....

so when i try the code it gives me error as ListControl in
WebForms is diffrent from that of SelectionListControl in
MobileWebForms.

when i apply the code (after changing the connection and
other changes for) u have send me i get error stating
somethin about Web Controls and Mobile controls.
the code u send is as follows (after that i have pasted my
MobileWebForm.aspx.cs code).

========== WebPage1.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

namespace DropdownList
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.ListBox slst1;

private void Page_Load(object sender,
System.EventArgs e)
{
// Put user code to initialize the page here
SqlConnection cnn = new SqlConnection("server(local);database=pubs;user
id=sa;pwdÞvsa");
cnn.Open();
string sql = "Select job_id, emp_id from
employee order by emp_id";

response.write(sql+"<br>");

SqlCommand cmd = new SqlCommand(sql, cnn);
SqlDataReader myReader = cmd.ExecuteReader();

while (myReader.Read())
{
string dt;
string myValue = "";
string myText = "";
ListItem myItem;

for (int i=0;i<myreader.fieldcount; i++)
{
dt = myReader.GetDataTypeName(i);
if((dt == "decimal")||(dt
== "smallint"))
{
myValue = myReader.GetInt16
(i).ToString();
}
if((dt == "varchar")||(dt == "char"))
{
myText = myReader.GetString(i);
myItem = new ListItem(myText,
myValue);
slst1.Items.Add(myItem);
}
}//end for
}//end while

myReader.Close();
cnn.Close();
}

///////////////////////////////////////////////////


the code i have is for MobileWebForm.aspx.cs

************************MobileWebForm.aspx.cs

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Globalization;
using System.IO;
using System.Data.SqlClient;


private void slst1_Load(object sender, System.EventArgs e)
{
#region Selection List for Station
1
SqlConnection newmyConnection =
new SqlConnection("user
id=sa;password=sa;server=challenge360;Trusted_Connection=no
;databaseºckTest");
string mySelectQuery = "SELECT
Station_ID, Station_Name FROM tblStation_Info";
SqlCommand myCommand = new
SqlCommand (mySelectQuery,newmyConnection);
newmyConnection.Open();
SqlDataReader myReader;
myReader = myCommand.ExecuteReader
();

while (myReader.Read())
{
for (int i=0;
i<myReader.FieldCount; i++)
{
string dt;
string val="";
dt =
myReader.GetDataTypeName(i);
if(dt == "decimal")
{

slst1.DataValueField = (myReader.GetDecimal
(i)).ToString();
val =
(myReader.GetDecimal(i)).ToString();
}
if(dt == "varchar")
{

slst1.DataValueField = val;

slst1.DataTextField = myReader.GetString(i);

slst1.Items.Add (myReader.GetString(i));
}
}//end for
}//end while

// always call Close when done
reading.
myReader.Close();
// Close the connection when done
with it.
newmyConnection.Close();
#endregion
}



#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required
by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support -
do not modify
/// the contents of this method with the
code editor.
/// </summary>
private void InitializeComponent()
{
this.cmdSchedule.Click += new
System.EventHandler(this.cmdSchedule_Click);
this.cmdBack.Click += new
System.EventHandler(this.cmdBack_Click);
this.Form2.Activate += new
System.EventHandler(this.Form2_Activate);
this.lst1.Load += new
System.EventHandler(this.lst1_Load);
this.cmdBooking.Click += new
System.EventHandler(this.cmdBooking_Click);
this.Form3.Activate += new
System.EventHandler(this.Form3_Activate);
this.cmdResv.Click += new
System.EventHandler(this.cmdResv_Click);
this.slst1.Load += new
System.EventHandler(this.slst1_Load);
this.slst2.Load += new
System.EventHandler(this.slst2_Load);
this.cmdSch.Click += new
System.EventHandler(this.cmdSch_Click);
this.Load += new
System.EventHandler(this.Page_Load);

}
#endregion

Infinit Loop

3/12/2002 6:16:00 PM

0

Jasim,

What was the problem.
Please share it with us.
Please don't just say I already found the problem without any details.
Thanks

"Jasim Iqbal" <jasim_iqbal@hotmail.com> wrote in message
news:aabe01c1c41a$63cd5780$35ef2ecf@TKMSFTNGXA11...
> thanx michael for ur reply, actually meanwhile i already
> found the problem ...
>
> but i do have another question ..
>
> i have made a selection list of type 'ListBox' .. now i
> have to add cities name to the list from a database and
> have to assign each cities_id from data base to the value
> like ....
>
> (HTML Code when viewed in IE browser)
> <select size="8" name="slst1">
> <option value=123>Chatham
> <option value=234>Guelph
> <option value=450>Kitchener
> <option value=890>London
> </select>
>
> but instead i get following code ...
>
> <select size="8" name="slst1">
> <option value="Chatham">Chatham
> <option value="Guelph">Guelph
> <option value="Kitchener">Kitchener
> <option value="London">London
> </select>
>
> my code for the control is as following ...
>
> CODE c-Sharp (in the code Station_ID should be 'value' and
> Station_Name should appear in the control to see)
> ******************************************
>
> private void slst1_Load(object sender, System.EventArgs e)
> {
> #region Show Code
> SqlConnection newmyConnection =
> new SqlConnection("user
> id=sa;password=sa;server=challenge360;Trusted_Connection=no
> ;database=BackTest");
> string mySelectQuery = "SELECT
> Station_ID, Station_Name FROM tblStation_Info";
> SqlCommand myCommand = new
> SqlCommand (mySelectQuery,newmyConnection);
> newmyConnection.Open();
> SqlDataReader myReader;
> myReader = myCommand.ExecuteReader
> ();
>
> while (myReader.Read())
> {
> for (int i=0;
> i<myReader.FieldCount; i++)
> {
> string dt;
> dt =
> myReader.GetDataTypeName(i);
> if(dt == "decimal")
> {
>
> slst1.DataValueField = (myReader.GetDecimal
> (i)).ToString();
> }
> if(dt == "varchar")
> {
>
> slst1.DataTextField = myReader.GetString(i);
>
> slst1.Items.Add (myReader.GetString(i));
> }
> }//end for
> Console.WriteLine();
> }//end while
>
> // always call Close when done
> reading.
> myReader.Close();
>
> Console.WriteLine("The Values are
> Shown!");
> // Close the connection when done
> with it.
> newmyConnection.Close();
> #endregion
> }
>
>