Quantcast
Channel: CSharp Forum Latest Questions
Viewing all 32065 articles
Browse latest View live

checkboxlist is not selected

$
0
0
Hi 

I have one checklist reading it from sqldatasource it was working fine to checked  the selected type the user saved it  before to  view you it in the  Edit form 

now it's not getting to the loop :(

this is my code 

SqlConnection con = new SqlConnection(myconn);
            string Reg = Session["Reg"].ToString();

            string sqlstr = "SELECT REG_no,Cat,Reg_date,ID FROM  tblSu_Details WHERE REG_no ='" + Label24.Text + "'";
            con.Open();
            SqlCommand cmd = new SqlCommand(sqlstr, con);
            cmd.CommandType = CommandType.Text;
            cmd.CommandTimeout = 15;
            SqlDataAdapter ad = new SqlDataAdapter(cmd);
            DataSet DS = new System.Data.DataSet(cmd.CommandText);

            ad.Fill(DS);

            
            string sqlstr2 = "SELECT ID_Tye, Type_Name FROM tblType where ID_Type =  " + DS.Tables[0].Rows[0].ItemArray[3].ToString();
            SqlCommand cmd2 = new SqlCommand(sqlstr2, con);
            cmd2.CommandType = CommandType.Text;
            cmd2.CommandTimeout = 15;

            SqlDataAdapter ad2 = new SqlDataAdapter(cmd2);
            DataSet DS2 = new System.Data.DataSet(cmd2.CommandText);
            ad2.Fill(DS2);
            if (DS2.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow drtmp in DS2.Tables[0].Rows)
                {
                    foreach (ListItem litem6 in chktype.Items)
                    {
                        if (litem6.Text == drtmp.ItemArray[1].ToString())
                        {
                            litem6.Selected = true;
                        }
                    }
                }
            }



CreateUserWizard - save data to own database

$
0
0
Hello ,

How to use Createusewizard control if i want to save data to my own database then how can i do that 

thnx in advance .

romove linkbutton on gridview

$
0
0
I am trying to delete selected link on gridview on base of two table id is equal when the id is equal then that link is remove or not
we have column on gridview is id, Description and date and i want to delete selected id link which is available in other table we are match both table id
how to remove row on grid view

status and commenting in C#

$
0
0
How we can implent the status and putting commenting on that status using csharp like facebook.

cloud computing

How to disable CTRL+ALT+DEL , CTRL+ESC, and win keys

$
0
0

hi,
        i'm developing kiosk application in windows forms. In that i want to disable win keys, ctrl+alt+del and so on...it should be like atm display screen.

kindly help me out with this...pls give give me code....

Adding Unicode Characters in HTML URL (eg=hindi, gujarati)

$
0
0
How to add Unicode characters in HTML Url ?
The Unicode characters may in Hindi, Gujarati.
I m creating a website in hindi, gujarati. So, I want to switch the URL address from english to hindi.
Please Help.................
Its Urgent


How to auto attach sql server database at setup in VS 2010

$
0
0
How to auto attach Sql Server Database to Sql Server at Setup using c# in VS2010..
 please help friends...!!!

Need small help in NFC app for Windows Phone

$
0
0
i m working on windows phone 8 api NFC .

pls help me below code

this code is working fine

 NdefUriRecord rec = new NdefUriRecord { Uri = "http://www.nfcinteractor.com/" };
  NdefMessage msg = new NdefMessage { rec };
  _device.PublishBinaryMessage("NDEF", msg.ToByteArray().AsBuffer(), MessageWrittenHandler);
  LogStatusMessage("Publishing message ...");


but simler  to this code not working and not showing any exe.. also

  NdefUriRecord rec = new NdefUriRecord { Uri = "nfcshare:Hello+world" };
  NdefMessage msg = new NdefMessage { rec };
  _device.PublishBinaryMessage("NDEF:WriteTag", msg.ToByteArray().AsBuffer(), MessageWrittenHandler);
  LogStatusMessage("Publishing message ...");


i m using hare WriteTag feature ,both  sample syntax is almost same.but second sample of code is not working .
i need your help for second sample syntax . where i missed ..



Sending Mail with specific domain name in asp.net

$
0
0
 I need to create a program to send mail with specific domain name to client mail id like 'chandan@mbitindia.com' to client  in asp.net

please anybody can help me..

Add controls(textbox) dynamically on button click in wp7 ??

$
0
0

This is Praveen.  Thanks for your help and support provided for my previous problem.

I am doing a small project of my own with help of the project which was given here( sample name : workingwithwp7).I'm sooo thankful for the person for giving that sample project with that i was able to learn and do my project so far very good.

My current problem is to add controls dynamically on tapping/clicking a button. I did some research on this problem and wasn't much help of it.

Please provide me with a solution/idea/if possible a sample for adding controls dynamically in the screen would a very helpful to me.

Thanks in Advance.

Show Progress Bar in Outlook Addins

$
0
0
i m developing a Outlook Add ins using C#. hare i extract all the attachment(in doc or docx) which is attach with selected mail. i have create a button on tool bar using add in.when i click on button then all the attachment with selected mail come in to my database.now my question is that when i click on button that time some processing happens during the processing time i want to show a progress bar on my outlook window untill its finish extraction.Can any one help me to out this problem. here i include code also with extract mails attachment and sent to database

Is it true to draw image ?

$
0
0
            BitmapImage image = new BitmapImage(new Uri("4ALHinDamascus.jpg", UriKind.Relative));
            g.DrawImage(Image image(),X,Y,30,30);

TextProperty OnTextChanged ändert nicht den Text

$
0
0
 Hallo Liebe Leute,

...OnTextChanged wird natürlich ausgelöst und die TextProperty bekommt einen neuen Wert scheint so aber der neue Wert wird nicht angezeigt:

XAML
<Window x:Class="WpfApplication5.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid Name="grid1" >
        <Grid.RowDefinitions>
            <RowDefinition Name="row0"/>
            <RowDefinition Name="row1"/>
        </Grid.RowDefinitions>
        <Button Margin=" 5" Click="HandleButtonClick"
                 Content="Wieviel Uhr ist es ? " />
        <TextBox HorizontalAlignment="Left" Height="116"
                 Margin="85,10,0,0" Grid.Row="1" TextWrapping="Wrap"
                  Name="txt" 
                 VerticalAlignment="Top" Width="333"/>
    </Grid>

    <x:Code>
        <![CDATA[
       
       
       
        ]]>
    </x:Code>
</Window>


C#:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication5
{
    /// <summary>
    /// Interaktionslogik für MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {


        public MainWindow()
        {

            InitializeComponent();

            DependencyPropertyDescriptor descriptor =
          DependencyPropertyDescriptor.FromProperty(
              TextBox.TextProperty, typeof(TextBox));

            descriptor.AddValueChanged(txt, OnTextChanged);
            //ThreadPool.QueueUserWorkItem((state) =>
            //{
            //    Thread.Sleep(1000);

            //    // do your work here
            //    // CAUTION: use Invoke where necessary
            //});

        }
       
        void HandleButtonClick(object sender, RoutedEventArgs e)
        {

            txt.Text = string.Format("Es ist {0:HH:mm:ss} Uhr.", DateTime.Now);

        }

        public void OnTextChanged(object sender, EventArgs e)
        {
          

            txt.Text = string.Format("Es ist {0:HH:mm:ss} Uhr.", DateTime.Now  );
        

        }


    }
}



Soll ich Threads hier verwenden ?

Send Data from windows form to website's pop up windows

$
0
0
I'm using vs 2010 & i'm working on windows form in which I've 2 text boxes, 1 button, 1 web browser control & i want whenever i click on that button, the data that entered in 2 text boxes should be transferred to the website's pop up window like i want enter data on 192.168.1.1 its username & password fields & should check whether entered data is correct or not. How can i get the name of that pop up window ? how can i do that ? 
Sorry for my bad english

Primary Key Violation Exception

$
0
0
HI 
    i created registration table in sqlserver and mention primary key for username.im able to insert records from front-end.but,while im refreshing(F5) the im getting sqlexception like "Primary Key Violation Exception".
 Cane someone help me on this exception.
   

How to create nodes and display them in a picture box WFA

$
0
0

Hy All

I am trying to create nodes with their connections and then presenting them in a picture box using the windows forms application in visual C#. I want ideas on how do I go about doing it since I am new to C#.

How to make a control like "TECHNOLOGIES" on this website

$
0
0
How to build a control in ASP.NET / JavaScript similar to the one on this web site...when I hover the mouse on "TECHNOLOGIES" (next to Home icon), a list of all technologies is displayed. How do I build such a control for Menu options.. Please suggest good reading 

data insertion issue

$
0
0
sir, i m trying this code but it is not doing anything no data is inserting into table and label is not changing its text, what to do now? 



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;

public partial class course : System.Web.UI.Page
{
//{   // string connStr = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
//// SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);

////     protected void Page_Load(object sender, EventArgs e)
////  {
//// con.Open();
////  }
////  protected void Button1_Click(object sender, EventArgs e)
//// {
//// //SqlConnection con = new SqlConnection(connStr);
//// SqlCommand cmd = new SqlCommand("insert into profile values('" + name.Text+ "','" + fname.Text+ "','" + ep.Text+ "','" + cls.Text+ "','" + semester.Text+ "')", con);

//////con.Open();
//// cmd.ExecuteNonQuery();
//////cm.ExecuteNonQuery();
////// con.Close();
    
//    SqlConnection con=new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
//    protected void Page_Load(object sender, EventArgs e)
//    {
//        con.Open();
//    }
//    protected void Button1_Click(object sender, EventArgs e)
//    {
//        //SqlCommand cmd = new SqlCommand("insert into profile(studentname,fathername,ep1,class,semester,courseId) values('" +TextBox1.Text + "','" +TextBox2.Text+ "', '" +TextBox3.Text+ "','"+s1+"')", con);
//        //cmd.ExecuteNonQuery();
//        //con.Close();
//        //Label1.Visible = true;
//        //Label1.Text = "Registered Successfully";
//        //TextBox1.Text = "";
//        //TextBox2.Text = "";
//        //TextBox3. Text = "";
        

//string s1 = string.Empty; 
//foreach (ListItem item in this.CheckBoxList1.Items)
//{ if (item.Selected)
// { s1 = item.ToString();
// SqlCommand com = new SqlCommand("insert into profile(studentname,fathername,ep1,class,semester,courseId) values('" + TextBox1.Text + "','" + TextBox2.Text + "', '" + TextBox3.Text + "','" + s1 + "')", con); 
//    com.CommandType = System.Data.CommandType.Text;
//    com.ExecuteNonQuery();
////com.ExecuteNonQuery();

//} }
//Response.Write("Inserted Successfully"); } } 

    protected void Button1_Click(object sender, EventArgs e)
    {

        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
        string s1 = string.Empty;
        foreach (ListItem item in this.CheckBoxList1.Items)
        {
            if (item.Selected)
            {
                s1 = item.ToString();
                SqlCommand cmd = new SqlCommand(@"INSERT INTO PROFILE(studentname,fathername,ep1,class,semester,courseId) VALUES (@STUDNAME,@PARNTNAME,@EP1NAME,@CLASS,@SEMESTER,@COURSEID)", conn);

                cmd.Parameters.AddWithValue("@STUDNAME", TextBox1.Text);
                cmd.Parameters.AddWithValue("@PARNTNAME", TextBox2.Text);
                cmd.Parameters.AddWithValue("@EP1NAME", TextBox3.Text);
                cmd.Parameters.AddWithValue("@CLASS", TextBox4.Text);
                cmd.Parameters.AddWithValue("@SEMESTER", TextBox5.Text);
                cmd.Parameters.AddWithValue("@COURSEID", s1);
                conn.Open();

                Int32 rowsInserted = cmd.ExecuteNonQuery();
                conn.Close();

                if (rowsInserted > 0)
                {
                    Label1.Visible = true;
                    Label1.Text = "Registered Successful";
                    TextBox1.Text = string.Empty;
                    TextBox2.Text = string.Empty;
                    TextBox3.Text = string.Empty;
                    TextBox4.Text = string.Empty;
                    TextBox5.Text = string.Empty;

                }
                else
                {
                    Label1.Visible = true;
                    Label1.Text = "Registration Failed";
                }
            }
        }
    }
            
        
        private void Form1_Load(object sender, EventArgs e)
        {
            Label1.Visible = false;
        }

}

is there a memory limit for the dispatcher

$
0
0
whenever i make it do a task it crash my app

even if i just request a simple new web broswer


Viewing all 32065 articles
Browse latest View live