Personalized lock screen

Microsoft Windows 8 Personalized lock screen. from windows.microsoft.com

The tiles of the Start screen

Microsoft Windows 8 The tiles of the Start screen from windows.microsoft.com.

Touch keyboard

Microsoft Windows 8 Touch keyboard from windows.microsoft.com.

C# reading data from Serial port

Question -

I have a device (a GPS type of device) that constantly pushes communication through a standard serial connection (COM1).

What I need to be able to do is:

Programatically:
1) Open the serial port
2) Listen for a given period of time (say 2 seconds) to the data that is being received via the serial port.
3) populate a multi-line text box with the data that was received from the serial port.
4) close teh serial port

Then I will build additional code surrounding handling the data in the textbox.


Answer -

I set up my serialport like this

sp.BaudRate = 115200;
sp.PortName = "COM53";
sp.DataBits = 8;
sp.StopBits = System.IO.Ports.StopBits.One;
sp.Parity = System.IO.Ports.Parity.None;
sp.ReadTimeout = 0;
sp.Open();
sp.DataReceived += new
System.IO.Ports.SerialDataReceivedEventHandler(sp_ DataReceived);


and then I have this

void sp_DataReceived(object sender,
System.IO.Ports.SerialDataReceivedEventArgs e)
{

string Mystring = sp.ReadExisting();
byte testbyte = 254;
// Gather all the bytes until 102 is reached
foreach (byte c in Mystring)
{
if(pixelcount<102) pixelcount ="="" testbyte =" {0}" oldx =" 0;" pixelcount =" 0;">

Connect to Microsoft SQL server 2008 (enterprise) database from Visual C# 2008 Express

Question -

i've created a new database using SQL server managment studio with no problem.
database via Management Studio there is no problem, the database appears in the Explorer.

however, in Visual C# Express, when I try to 'Add Connection' as follows

Data source - MS SQL Server Database File
Database File Name - browse to appropriate folder and select
Log in using WIndows Authentification

And use the same database I receive the message (after a while):
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"

and yes i did detach the database / disable windows firewall / shutdown anti-virus sw before i try to connect.

* also, let me say i manage to connect for OLE DB (Access 2007) with no problems

does visual c# express edtion got to do with this problem, i mean if full version of visual studio can solve the problem ?

Looking for a solution if possible for the SQL server 2008.


Answer -

Upgrade will definitely solve the problem. The full version of Visual Studio provides support to SQL Server.
The comment about "Real" SQL Server, means that you can connect to the server itself (rather than just the SQL Server files)
I have heard of folks who just bypass the connection wizard and code the connection to the SQL Server "by hand". Using this technique, you *can* use C# Express to connect to a SQL Server... but you've got to do all the work.

How to use GridView and DataSets in C#.NET 2.0?

Question -

I need a example of how to create a gridview in .cs versus just dragging and dropping the gridview on the aspx page?

I created a dataset and called a stored procedure using data adapter, but i do not know how to data bind the data set into the grid view I have.

It seems everywhere I search the gridview examples they have is just dragging and dropping to the page and configuring a datasource.
Answer -

//connect to database via dataset & dataadapte
SqlConnection con = new SqlConnection("server=localhost;Initial Catalog=databasename;uid=;pwd=;");
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter("stored proc name", con);
da.SelectCommand.CommandType = CommandType.StoredProcedure;
da.Fill(ds);

//create gridview by code & bind dataset to it
GridView g = new GridView();
Page.Controls.Add(g);
g.DataSource = ds;
Page.DataBind();