ss125 18 Posting Whiz in Training

very simple my friend.

First add a dummy ID in the databse

for eg,

empid empname

1 admin

then before insert find the max(empid)

then add one to it.

and include it in every query you process.

This can be done in frontend.

I am not the one who can help in databse side.

But I am sure that autoincrement is there at mysql I hope.

May be the one who is good at database can help you on that....

Hope this helps you...

Have a happie coding...:=D

saguni commented: old methodology, but it will work i hope. +0
ss125 18 Posting Whiz in Training

In Tamil there is statement,"Manusana ivan!!!"

I hope that suits you well @JorgeM...

It means, You are a beast in knowledge...

ss125 18 Posting Whiz in Training

Just to add with @deceptikon,

when an if statement is written in a function, then all the paths(i.e., if statements) must return a value, other than the common return value of the function.

Hope this helps you..

Have a happy coding...:-D

ss125 18 Posting Whiz in Training

@AARTI SHRIVAS
What you said is a point to be considered, but there is a quote "Revealing the truth is better then hiding them".

ss125 18 Posting Whiz in Training

Well this is my excel upload file...

if (FileUpload1.HasFile)
                {
                    string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
                    string fileExtension = Path.GetExtension(FileUpload1.PostedFile.FileName);
                    string fileLocation = Server.MapPath("~/App_Data/" + fileName);
                    FileUpload1.SaveAs(fileLocation);
                    //Check whether file extension is xls or xslx
                    if (fileExtension == ".xls")
                    {
                        connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileLocation + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";
                    }
                    else if (fileExtension == ".xlsx")
                    {
                        connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileLocation + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
                    }

                    //Create OleDB Connection and OleDb Command
                    OleDbConnection con = new OleDbConnection(connectionString);
                    OleDbCommand cmd = new OleDbCommand();
                    cmd.CommandType = System.Data.CommandType.Text;
                    cmd.Connection = con;
                    OleDbDataAdapter dAdapter = new OleDbDataAdapter(cmd);
                    DataTable dtExcelRecords = new DataTable();
                    con.Open();
                    DataTable dtExcelSheetName = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
                    string getExcelSheetName = dtExcelSheetName.Rows[0]["Table_Name"].ToString();
                    cmd.CommandText = "SELECT * FROM [" + getExcelSheetName + "]";
                    dAdapter.SelectCommand = cmd;
                    dAdapter.Fill(dtExcelRecords);
                    con.Close();
                    GridView1.DataSource = dtExcelRecords;
                    GridView1 .DataBind();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("The error is"+ex);
            }

To be frank, I used validation at front end to write in the excel file. So there is no need for checking the empty values of data. But based on your problem you need to check the excel file itself(since it is unknown to me.)

So, I can suggest a way to populate the dataset manually.

The following code shows how to populate the record manually

DataTable workTable = new DataTable("Customers");

DataColumn workCol = workTable.Columns.Add("CustID", typeof(Int32));
workCol.AllowDBNull = false;
workCol.Unique = true;

workTable.Columns.Add("CustLName", typeof(String));
workTable.Columns.Add("CustFName", typeof(String));
workTable.Columns.Add("Purchases", typeof(Double));

after that you have to declare a loop like

while (csv.ReadNextRecord())
        {
            for (int i = 0; i < …
saguni commented: awesome effort!!! Keep it up!!! +0
ss125 18 Posting Whiz in Training

It may be wrong but I think the problem is with your updater statement.

cmd = new OleDbCommand("UPDATE [Seranne] SET [Quantity] ='" + newVal + "' WHERE [Code] IN ('");

There is a unended round bracket in your query.

Correct me if I am wrong Ketsuekiame and ddanbe...

Ketsuekiame commented: Well spotted +9
ss125 18 Posting Whiz in Training

@Stuugie,
FYI:
There are several areas where we nweed to import or export inside an application. Even I had went accros the problem. Recent times, some clients of our company also asks application with features like these.

@gayzlein,
It can be done my friend. I have done that using c#. You can also do that in vb.net. Here are some link that can help you...

Link1
Click Here

Hope this helps you.

Next time while posting your problem, provide us with the codes you tried. So that we can help you in a easy way.

Have a happy coding...:-D

Stuugie commented: Thanks for the FYI. +4
saguni commented: Yess... This is a trouble in the ass to the developer,but it is a gift to the end user to upload a single file and update the database within seconds... Well said friend... +0
ss125 18 Posting Whiz in Training

Well as @nitin said, I remember the head of Google's Android team was also a Indian.

nitin1 commented: damn true!! this proves the intelligence level of Indian Engineers +0
ss125 18 Posting Whiz in Training

Thank you @ChrisHunter and @Ketsuekiame.

A few moments ago, I figurred out a solution to pass the selected values to a query.

My problem is to select multiple username from the dropdownlist and on a single click I have to deactivate all the selected users. At first I am out of solution, but later I figured out the solution.

So here is what I did.

I got all the selected username to followed by a delete user sqlcommand inside the loop.. So my goal is acheived... :-D

saguni commented: That solved my problem too dude.I love you. Thank you. +0
ss125 18 Posting Whiz in Training

The first thing you have to do when a error popup must be dubugging. So properly debug the code execution flow. check what are the values in the declared variable in you form. By using this, You can easily findout the error and cause for the error.

Since you are new to this,try the following link

http://www.vbforums.com/showthread.php?516261-Using-VB6-Debug-Introduction

anyway try to code it as shown below.

    Private Sub txtpwd_KeyPress(KeyAscii As Integer)
        If KeyAscii = vbEnter Then
        If Len(Trim(txtlogin)) > 0 And Len(Trim(txtpwd)) > 0 Then
        If CheckPwd(txtlogin, txtpwd) = "ok" Then
        MsgBox "Password ok"
        Else
        MsgBox "Wrong password or Login not found."
        End If
        Else
        MsgBox "Login and password should not be blank"
        End If
        End If
    End Sub
    Private Function CheckPwd(cLogin As String, cPwd As String)
        'in my case i will use dao. you probably using ado just convert it
        Dim rs As Recordset, ret As String
        Set rs = opendatabase("c:\temp\login.mdb").openrecordset("select * from tbllogin where ucase(trim(logname)) = '" & UCase(Trim(cLogin)) & "'")
        If rs.RecordCount <> 0 Then
        If UCase(Trim(rs("pword"))) = UCase(Trim(cPwd)) Then
        ret = "ok"
        Else
        ret = "wrong"
        End If
        Else
        ret = "wrong"
        End If
        rs.Close: CheckPwd = ret
    End Function

Because I hope the problem is in your logic. So try the above code logic.

Hope it helps you...

Have a happy coding...:-D

ss125 18 Posting Whiz in Training

Use like this...

con.Open();
SqlCommand cmd = new SqlCommand("select stu_id,t1_eng,t1_tam,t1_mat,t1_sci,t1_soc,t1_tot from sps_stu where stu_id=" + stu_id + " and class='" + cls + "'", con);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
GridView1.Visible = true;
GridView1.EditIndex = -1;
con.Close();

Hope this helps you.

Have a happy coding...:-D

ss125 18 Posting Whiz in Training

This is my personnal opinion. If my post hurts anyone,I am sorry. But I have to put this point here

To be frank, the engineering colleges have become an bussiness rather than being as a service to provide knowledge.

Its creating machines that can write for long period without handpain and machines that can memorize anything without understanding.

I am a person who completed my engineering under anna university,Chennai,India. According to the outer world its a heaven for students. But for those who are studying there,its a ___________. I dont wanna to say this here.

Those who wanna to know what i was going to say before kindly check this linkClick Here

ss125 18 Posting Whiz in Training

Only the programs that are installed will only be removed. And it will not affect your files in c: drive[OS drive]...

If its a licensed product you will have the installation schemas with you.

Else If you think that it may cause trouble to other programs try other means like manual editing of registry or there are more software to clean the unwanted registry entries. Both are riskless if you are aware of what you are doing.

So dont worry my friend...

ss125 18 Posting Whiz in Training

Its the Blur effect.It can be done in Photoshop also.

TO do that follow these steps.Its simple.

1) Open the image.
2) Select the particular part or the entire image which u need to blur.
3) Go to filter menu and select any kind of blur(i.e., Guassian blur,Motin Blur,etc)
4) The angle and ratio selection window will appear with a zoomed preview.Adjust it based on your necessity.
5)Press ok.

And save the image.

Your Blurred image is ready.

Happie Photoediting...

ss125 18 Posting Whiz in Training

Instead of programmming like this why cant you do like this...

void main()
{
String operator=""; 
String num1;
String num2;
String result;
if add_button is pressed
{
    num1=text1.value;
    operator="add"
}

Likewise same for all other math functions.

And for equalto

if equal_button onclick()
{
if(operator=="")
{
//alert user
}
if(operator="add")
{
num2=text1.value;
int res=num1+num2;
result=res.tostring();
text1.value=result;
}

My syntax may be wrong...But I am ask you about the logic used.

Have a happie coding...:-D

ss125 18 Posting Whiz in Training

If your carrier is on networking, then try to moniter protocol with application that can be used to allow/block the functionalities of that particular protocol. In simple, Just develop a firewall on your own.

ss125 18 Posting Whiz in Training

There is nothing to get demotivated in this. A true resourseful person will always comes up from the utmost bottom of the line like bubbling of air from under water. You must consider all your failure as a lesson to avoid the failures in the future. Dont get carried away by your failure alone.

Remember,

Failure is the Key to Success

And remember that the same companies will going to offer a job to you, willingly, and you will become such a person who selects the oppurtunities from the list of companies that rejected you now.

Wait for your time.

Keep on trying until your goal is reached my friend.

Regards,
ss125

ss125 18 Posting Whiz in Training

If u are using c# in web app, Use fileupload tool and get the path using

fileupload1.filename()

if it is a windows application

try

        openFileDialog1.ShowDialog();
        string filePath = openFileDialog1.FileName;

Hope this helps.

Have a happy coding.

ss125 18 Posting Whiz in Training

I also go with the above comments...

But I am having a suggestion here...

declare a varible to store the string to be printed(as mentioned in your question)

just use the builtin function strlen(variable name) to calculate how many characters are there in the variable.

Then get the price per letter

Calculate the result.

A simple method :-D

But if you need for loop then go with manual counting procedure as others suggested.

Hope this helps you.

Have a happy coding time..